Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[*.yml]
indent_style = space
indent_size = 2

[*.json]
indent_style = space
indent_size = 4
104 changes: 0 additions & 104 deletions .eleventy.js

This file was deleted.

2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

15 changes: 0 additions & 15 deletions .eslintrc.json

This file was deleted.

16 changes: 0 additions & 16 deletions .fluidlintallrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
node_modules
dist
_site
src/_data/assets.json
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
npx --no -- commitlint --config commitlint.config.mjs --edit "$1"
npx --no -- commitlint --edit "$1"
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
npx --no fluid-lint-all
npx --no lint-staged
10 changes: 10 additions & 0 deletions .markdownlint-cli2.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import markdownlintConfig from '@inclusive-design/markdownlint-config';

export default {
config: Object.assign(markdownlintConfig.config, {
'no-hard-tabs': {
code_blocks: false,
},
}),
ignores: ['node_modules', 'src/documents/**', 'CHANGELOG.md'],
};
3 changes: 0 additions & 3 deletions .stylelintrc.json

This file was deleted.

11 changes: 5 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
FROM node:24-alpine AS builder
FROM node:24.16.0-alpine3.23 AS builder

WORKDIR /app

RUN apk add --no-cache git
COPY package*.json ./

COPY package.json ./
COPY package-lock.json ./
RUN apk add --no-cache git

RUN npm ci

COPY . ./

RUN npm run build

FROM nginx:1.29.4-alpine
FROM nginx:1.31-alpine3.23

COPY --from=builder /app/dist /usr/share/nginx/html
COPY --from=builder /app/_site /usr/share/nginx/html
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Inclusive Learning Design Handbook

[![Netlify Status](https://api.netlify.com/api/v1/badges/7d5c6794-ebd2-4908-8918-3207a3f54251/deploy-status)](https://app.netlify.com/sites/idrc-inclusive-design-guide/deploys)
# Inclusive Design Guide

This project contains the content needed to build and deploy a copy of the Inclusive Design Guide. Please see the
[Contributor Guide](./CONTRIBUTING.md) for information on localizing the content.
Expand Down Expand Up @@ -29,11 +27,11 @@ If you make changes to the website, repeat the steps to build the image and star

### To build for deployment to a personal web server

1. Install the required NPM packages: `npm install`
1. Install the required NPM packages: `npm ci`
2. Run the build script: `npm run build`
3. Upload the contents of the `./dist/` directory to the web root of your server.
3. Upload the contents of the `./_site/` directory to the web root of your server.

If you make changes to the website, repeat step 2 to build the website and upload any changed files from the `./dist/`
If you make changes to the website, repeat step 2 to build the website and upload any changed files from the `./_site/`
directory to the web root of your server.

## License Information
Expand Down
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default { extends: ['@commitlint/config-conventional'] };
1 change: 0 additions & 1 deletion commitlint.config.mjs

This file was deleted.

73 changes: 73 additions & 0 deletions eleventy.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@

import process from 'node:process';
import fluidPlugin, { __ } from 'eleventy-plugin-fluid';
import eleventyNavigationPlugin from '@11ty/eleventy-navigation';
import wrap from './src/_shortcodes/wrap.js';
import siteConfig from './src/_data/config.json' with { type: 'json' };
import findTranslationKeyFilter from './src/_filters/find-translation-key-filter.js';

/**
* @param {import("@11ty/eleventy").UserConfig} eleventyConfig An instance of Eleventy's UserConfig class.
* @returns {object} The configuration object.
*/
export default function eleventy(eleventyConfig) {
eleventyConfig.setUseGitIgnore(false);

// Plugins
eleventyConfig.addPlugin(eleventyNavigationPlugin);
eleventyConfig.addPlugin(fluidPlugin, {
defaultLanguage: 'en',
supportedLanguages: {
en: {
slug: 'en',
uioSlug: 'en_CA',
dir: 'ltr',
name: 'English',
},
fr: {
slug: 'fr',
name: 'Français',
dir: 'ltr',
uioSlug: 'fr',
},
},
});

// Filters
eleventyConfig.addFilter('findTranslationKey', findTranslationKeyFilter);

// Shortcodes
eleventyConfig.addPairedShortcode('unmarkedList', (content) =>
wrap(content, 'list-articles'));
eleventyConfig.addShortcode('svg_sprite', (sprite) => `<svg class="idg-${sprite}" aria-hidden="true"><use xlink:href="/assets/images/sprites.svg#${sprite}"></use></svg>`);

// Passthrough copy
eleventyConfig.addPassthroughCopy({ 'src/admin/config.yml': 'admin/config.yml' });
eleventyConfig.addPassthroughCopy({ 'src/_redirects': '_redirects' });
eleventyConfig.addPassthroughCopy({ 'src/assets/images': 'assets/images' });
eleventyConfig.addPassthroughCopy({ 'src/assets/fonts': 'assets/fonts' });

// Custom collections
for (const lang of ['en', 'fr']) {
eleventyConfig.addCollection(`Activities_${lang}`, (collection) => collection.getFilteredByGlob(`./src/documents/activities/${lang}/*.md`));
eleventyConfig.addCollection(`Insights_${lang}`, (collection) => collection.getFilteredByGlob(`./src/documents/insights/${lang}/*.md`));
eleventyConfig.addCollection(`Practices_${lang}`, (collection) => collection.getFilteredByGlob(`./src/documents/practices/${lang}/*.md`));
eleventyConfig.addCollection(`Tools_${lang}`, (collection) => collection.getFilteredByGlob(`./src/documents/tools/${lang}/*.md`));
}

eleventyConfig.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: '_site',
},
passthroughFileCopy: true,
markdownTemplateEngine: 'njk',
};
}
14 changes: 14 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineConfig } from 'eslint/config';
import eslintConfigInclusiveDesign from '@inclusive-design/eslint-config';

export default defineConfig([
{
extends: [eslintConfigInclusiveDesign],
rules: {
camelcase: ['error', { properties: 'never' }],
},
},
{
ignores: ['_site/**', 'README.md'],
},
]);
3 changes: 0 additions & 3 deletions netlify.toml

This file was deleted.

Loading