-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Update website design (GH-46) #48
Changes from 39 commits
69723a9
c568564
851b8c5
811a0a0
c8cd51d
b95df6b
50c1a3d
744bc57
f3e4b50
a4559ce
bdc39a8
7d08dea
ea365b8
9632b19
5304147
b6fa226
3239179
6387a37
026b194
66aa7da
c847dd1
40c292b
8388c27
3a2ee77
12a2aff
b699885
c7c63e6
a489e44
87300e1
d1545a3
23b9c53
da8e4b7
c24b231
5343d27
acce6cf
91b7d15
f4744d6
323bc13
ebcd99d
5ee1aff
2a22d52
e6f8f0c
91df59d
136faaa
cd624e9
ead1f20
500d4a9
90da9eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
root = true | ||
|
||
[*] | ||
insert_final_newline = true | ||
|
||
[*.js] | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
[*.yml] | ||
indent_style = space | ||
indent_size = 2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,104 @@ | ||
/* | ||
Copyright the Inclusive Learning Design Handbook copyright holders. | ||
|
||
See the AUTHORS.md file at the top-level directory of this distribution and at | ||
https://github.com/fluid-project/handbook.floeproject.org/raw/main/AUTHORS.md. | ||
|
||
Licensed under the New BSD license. You may not use this file except in compliance with this License. | ||
|
||
You may obtain a copy of the New BSD License at | ||
https://github.com/fluid-project/handbook.floeproject.org/raw/main/LICENSE.md. | ||
*/ | ||
|
||
"use strict"; | ||
|
||
const fs = require("fs"); | ||
const fluidPlugin = require("@fluid-project/eleventy-plugin-fluid"); | ||
|
||
const fluidPlugin = require("eleventy-plugin-fluid"); | ||
const { EleventyRenderPlugin } = require("@11ty/eleventy"); | ||
const MarkdownIt = require("markdown-it"); | ||
const navigationPlugin = require("@11ty/eleventy-navigation"); | ||
const rssPlugin = require("@11ty/eleventy-plugin-rss"); | ||
const syntaxHighlightPlugin = require("@11ty/eleventy-plugin-syntaxhighlight"); | ||
|
||
// Import transforms | ||
const htmlMinTransform = require("./src/transforms/html-min-transform.js"); | ||
const parseTransform = require("./src/transforms/parse-transform.js"); | ||
|
||
// Import data files | ||
const siteConfig = require("./src/_data/config.json"); | ||
const getResourceLinks = require("./src/utils/getResourceLinks.js"); | ||
|
||
module.exports = function (config) { | ||
config.setUseGitIgnore(false); | ||
|
||
// Layouts | ||
config.addLayoutAlias("default", "layouts/default.njk"); | ||
|
||
// Plugins | ||
config.addPlugin(fluidPlugin); | ||
config.addPlugin(navigationPlugin); | ||
config.addPlugin(syntaxHighlightPlugin); | ||
// Filters | ||
const md = new MarkdownIt({ | ||
html: true, | ||
quotes: "“”‘’" | ||
}); | ||
config.addFilter("markdown", (content) => { | ||
return md.render(content); | ||
}); | ||
|
||
// Transforms | ||
config.addTransform("htmlmin", htmlMinTransform); | ||
config.addTransform("parse", parseTransform); | ||
|
||
// Passthrough copy | ||
config.addPassthroughCopy("src/_redirects"); | ||
config.addPassthroughCopy({"src/assets/images": "assets/images"}); | ||
config.addPassthroughCopy({"src/admin/config.yml": "admin/config.yml"}); | ||
config.addPassthroughCopy({"src/assets/fonts": "assets/fonts"}); | ||
config.addPassthroughCopy({"node_modules/docs-core/src/static/css": "assets/styles"}); | ||
config.addPassthroughCopy({"node_modules/docs-core/src/static/lib": "lib"}); | ||
config.addPassthroughCopy({"src/assets/icons": "/"}); | ||
config.addPassthroughCopy({"src/assets/images": "assets/images"}); | ||
|
||
// Plugins | ||
config.addPlugin(EleventyRenderPlugin); | ||
config.addPlugin(fluidPlugin); | ||
config.addPlugin(navigationPlugin); | ||
config.addPlugin(rssPlugin); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What was the discussion result regarding whether the RSS feed code should be kept in the repo? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We decided that it did not make sense in this context; the ILDH is more of a book to which we add chapters occasionally rather than a news site in the same vein as, for example, the Floe Project site. I'll remove the code associated with this functionality |
||
config.addPlugin(syntaxHighlightPlugin); | ||
|
||
// BrowserSync | ||
// Shortcodes | ||
config.addShortcode("svg_sprite", (sprite, altText, ariaHidden = true) => { | ||
const altTextMarkup = altText ? `<title>${altText}</title>` : ""; | ||
const ariaHiddenMarkup = ariaHidden ? " aria-hidden=\"true\"" : ""; | ||
return `<svg class="ildh-${sprite}"${ariaHiddenMarkup}>${altTextMarkup}<use xlink:href="/assets/images/sprites.svg#${sprite}"></use></svg>`; | ||
}); | ||
|
||
config.addShortcode("extract_resource_links", (content, sideContentHeadings, lang) => { | ||
return getResourceLinks(content, sideContentHeadings, lang); | ||
}); | ||
|
||
// 404 | ||
config.setBrowserSyncConfig({ | ||
callbacks: { | ||
ready: (error, browserSync) => { | ||
const content404 = fs.readFileSync("dist/404.html"); | ||
ready: function (err, bs) { | ||
|
||
browserSync.addMiddleware("*", (request, response) => { | ||
bs.addMiddleware("*", (req, res) => { | ||
const content_404 = fs.readFileSync("dist/404.html"); | ||
// Provides the 404 content without redirect. | ||
response.write(content404); | ||
response.writeHead(404); | ||
response.end(); | ||
res.write(content_404); | ||
res.writeHead(404); | ||
res.end(); | ||
}); | ||
} | ||
} | ||
}); | ||
|
||
config.on("beforeBuild", () => { | ||
if (!siteConfig.languages[siteConfig.defaultLanguage]) { | ||
process.exitCode = 1; | ||
throw new Error(`The default language, ${siteConfig.defaultLanguage}, configured in src/_data/config.json is not one of your site's supported languages.`); | ||
} | ||
}); | ||
|
||
return { | ||
dir: { | ||
input: "src", | ||
output: "dist" | ||
input: "src", | ||
output: "dist", | ||
includes: "_includes" | ||
}, | ||
passthroughFileCopy: true | ||
}; | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"lintspaces": { | ||
"newlines": { | ||
"excludes": ["./src/assets/fonts/*.ttf"] | ||
}, | ||
"jsonindentation": { | ||
"excludes": ["./src/_data/*.json"] | ||
} | ||
}, | ||
"markdownlint": { | ||
"includes": ["./.github/**/*.md", "./CHANGELOG.md"], | ||
"excludes": [ | ||
"./.github/pull_request_template.md", | ||
"./src/collections/pages/en-CA/footer-context.md", | ||
"./src/collections/pages/en-CA/footer-credits.md", | ||
"./src/collections/pages/en-CA/footer-tagline.md", | ||
"./src/collections/pages/en-CA/toolkits-and-guides.md" | ||
] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: Bug | ||
assignees: '' | ||
--- | ||
|
||
## Describe the bug | ||
|
||
A clear and concise description of what the bug is. | ||
|
||
### To reproduce | ||
|
||
Steps to reproduce the behavior: | ||
|
||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
### Expected behavior | ||
|
||
A clear and concise description of what you expected to happen. | ||
|
||
## Screenshots | ||
|
||
If applicable, add screenshots to help explain your problem. | ||
|
||
## Technical details | ||
|
||
### Desktop | ||
|
||
- OS: [e.g. iOS] | ||
- Browser & version: [e.g. Chrome 95, Safari 14] | ||
|
||
### Mobile device | ||
|
||
- Device: [e.g. iPhone6] | ||
- OS: [e.g. iOS8.1] | ||
- Browser & version: [e.g. stock browser, Safari 15] | ||
|
||
### Assistive technology used | ||
|
||
- Name: [Name of assistive technology] | ||
- Version: [e.g. 22] | ||
|
||
## Additional context or notes | ||
|
||
Add any other context about the problem here. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: Enhancement | ||
assignees: '' | ||
--- | ||
|
||
## Is your feature request related to a problem? | ||
|
||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
## Describe the solution you'd like | ||
|
||
A clear and concise description of what you want to happen. | ||
|
||
## Describe alternative solutions you've considered | ||
|
||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
## Additional context or notes | ||
|
||
Add any other context or screenshots about the feature request here. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
# Enable version updates for npm | ||
- package-ecosystem: "npm" | ||
# Look for `package.json` and `lock` files in the `root` directory | ||
directory: "/" | ||
# Check for updates once a month | ||
schedule: | ||
interval: "monthly" | ||
allow: | ||
# Allow direct updates only (for packages named in package.json) | ||
- dependency-type: "direct" | ||
ignore: | ||
- dependency-name: "husky" | ||
versions: [">=5"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
* [ ] This pull request has been linted by running `npm run lint` without errors | ||
* [ ] This pull request has been tested by running `npm run start` and reviewing affected routes | ||
* [ ] This pull request has been built by running `npm run build` without errors | ||
* [ ] This isn't a duplicate of an existing pull request | ||
|
||
## Description | ||
|
||
<!-- A description of the pull request --> | ||
|
||
## Steps to test | ||
|
||
1. <!-- First step --> | ||
2. <!-- Second step --> | ||
3. <!-- and so on... --> | ||
|
||
**Expected behavior:** <!-- What should happen --> | ||
|
||
## Additional information | ||
|
||
<!-- Please provide any additional information that can help us review your contribution. --> | ||
|
||
## Related issues | ||
|
||
<!-- If this pull request resolves an issue, please indicate the issue number here, e.g. 'Resolves #42' --> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Cache node modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }} | ||
- name: Install dependencies | ||
run: | | ||
npm i | ||
env: | ||
CI: true | ||
- name: Lint JavaScript and JSON files | ||
run: | | ||
npm run lint | ||
env: | ||
CI: true | ||
- name: Build with Docker | ||
run: docker build . | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Publish release | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given that the Netlify settings for this site specify the image and command to use for building the site, it seems you're correct that we don't need to keep this action |
||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: google-github-actions/release-please-action@v3 | ||
id: release | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
release-type: node | ||
package-name: handbook.floeproject.org |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
dist | ||
node_modules | ||
dist | ||
src/_data/assets.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "stylelint-config-fluid" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Authors | ||
|
||
## Copyright Holders | ||
|
||
Copyright 2015-2022 | ||
|
||
This is the list of Inclusive Learning Design Handbook copyright holders. It does not list all individual contributors | ||
because some have assigned copyright to an institution, only made minor changes, or their contributions no longer appear | ||
in the codebase. Please see the version control system's revision history for details on contributions. | ||
|
||
* OCAD University | ||
|
||
## Contributors | ||
|
||
Individual contributions can be viewed on the | ||
[Contributors](https://github.com/fluid-project/handbook.floeproject.org/graphs/contributors) page, | ||
or through the version control system's revision history. | ||
|
||
**Note**: Individual authors may not hold copyright. See above "Copyright Holders" section for more information. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we discussed before, content will be edited via Github pull requests. The admin page is unnecessary for this project and it's not working as well. Shall we remove the admin related code and documentation from this pull request?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a reasonable step at this point. If anyone would like to add admin functionality into the site, they could find the necessary code in Trivet. I could also add a note to this effect in the Readme