Skip to content
This repository was archived by the owner on Apr 19, 2024. It is now read-only.

Commit 7a76233

Browse files
committed
release: public 1.1.0
JIRA-Ref: release/1.1.0
0 parents  commit 7a76233

File tree

352 files changed

+15631
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

352 files changed

+15631
-0
lines changed

.app-eleventy.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const cc = require('config-chain');
2+
3+
var conf = cc(cc.find('.jam-on/app/conf.json'));
4+
5+
appConfigFunc = function (eleventyConfig) {
6+
eleventyConfig.addPassthroughCopy({
7+
'src/assets': conf.get('assetsDestination'),
8+
});
9+
};
10+
11+
appConfigObj = {
12+
dir: {
13+
input: 'src',
14+
output: 'dist',
15+
},
16+
};
17+
18+
module.exports = {
19+
configFunc: appConfigFunc,
20+
configObj: appConfigObj,
21+
};

.core-eleventy.js

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
const globalLocaleStrings = require('./src/_data/core/core-locale-strings.json');
2+
const appLocaleStrings = require('./src/_data/app/app-locale-strings.json');
3+
const localeStrings = { ...globalLocaleStrings, ...appLocaleStrings };
4+
5+
const fs = require('fs');
6+
const matter = require('gray-matter');
7+
const markdownIt = require('markdown-it');
8+
9+
coreConfigFunc = function (eleventyConfig) {
10+
const md = new markdownIt({
11+
html: true,
12+
});
13+
14+
eleventyConfig.addFilter('markdown', (content) => {
15+
return md.renderInline(content);
16+
});
17+
18+
eleventyConfig.addShortcode(
19+
'currentYear',
20+
() => `${String(new Date().getFullYear())}`
21+
);
22+
eleventyConfig.addShortcode(
23+
'currentShortYear',
24+
() => `${String(new Date().getFullYear()).slice(-2)}`
25+
);
26+
27+
eleventyConfig.addFilter('localeString', function (key) {
28+
// Solution for accessing page front matter from https://stackoverflow.com/a/67746326
29+
30+
var page = this.ctx.page;
31+
var str = fs.readFileSync(page.inputPath, 'utf8');
32+
var data = matter(str).data;
33+
var lang = data.lang || 'en';
34+
35+
if (key.includes('.')) {
36+
var keyArr = key.split('.');
37+
var localeString = localeStrings[keyArr.shift()];
38+
if (keyArr.length > 0) {
39+
keyArr.forEach((key) => {
40+
localeString = localeString[key];
41+
});
42+
}
43+
} else {
44+
var localeString = localeStrings[key];
45+
}
46+
if (Array.isArray(localeString)) {
47+
localeString = localeString.map((str) => {
48+
return str[lang];
49+
});
50+
return localeString;
51+
}
52+
return `${localeString[lang]}`;
53+
});
54+
};
55+
56+
coreConfigObj = {
57+
pathPrefix: '/',
58+
};
59+
60+
module.exports = {
61+
configFunc: coreConfigFunc,
62+
configObj: coreConfigObj,
63+
};

.eleventy.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const core = require('./.core-eleventy.js');
2+
const app = require('./.app-eleventy.js');
3+
4+
module.exports = function (eleventyConfig) {
5+
core.configFunc(eleventyConfig);
6+
app.configFunc(eleventyConfig);
7+
8+
// Return your Object options:
9+
return { ...core.configObj, ...app.configObj };
10+
};

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist

.htmlvalidate.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": ["html-validate:recommended"],
3+
"rules": {
4+
"void-style": "off",
5+
"prefer-button": "off",
6+
"svg-focusable": "off",
7+
"no-trailing-whitespace": "off",
8+
"long-title": "off"
9+
}
10+
}

.htmlvalidateignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
src/jamstack-toolkit/assets/vendor/**
2+
dist/assets/vendor/**

.jam-on/app/conf.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"assetsDestination": "example-pages/assets",
3+
"englishRoot": "example-pages",
4+
"frenchRoot": "pages-dexemple"
5+
}

.jam-on/core/templates/en.njk

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
layout: core/layout.njk
3+
title: "Ontario.ca Jamstack Toolkit"
4+
description: "The best way to start building applications for Ontario.ca."
5+
fr_page_url: "/{{ frenchRoot }}"
6+
date: {{ createDate }}
7+
published_date: {{ createDate }}
8+
---
9+
English Page.

.jam-on/core/templates/fr.njk

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
layout: core/layout.njk
3+
title: "Boîte à outils Jamstack Ontario.ca"
4+
description: "La meilleure façon de commencer à créer des applications pour Ontario.ca."
5+
lang: fr
6+
en_page_url: "/{{ englishRoot }}"
7+
date: {{ createDate }}
8+
published_date: {{ createDate }}
9+
---
10+
French Page

.jam-on/core/templates/package.njk

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "{{ projectName }}",
3+
"version": "0.0.1",
4+
"description": "{{ projectDescription }}",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "npm run build && mocha",
8+
"lint": "rm -rf dist && eleventy & npm run htmlValidateDist",
9+
"build": "rm -rf dist && eleventy",
10+
"serve": "eleventy --serve",
11+
"htmlValidateSrc": "html-validate src/**/*.njk",
12+
"htmlValidateDist": "html-validate dist/**/*.html",
13+
"formatCode": "npx prettier --write .",
14+
"installDesignSystem": "export DS_VERSION=0.12.13 && export DS_ZIP_NAME=ontario-design-system.zip && export VEN_DIR=src/assets/vendor && export DS_UNZIP_DIR=$VEN_DIR/ontario-design-system && curl https://designsystem.ontario.ca/dist/ontario-design-system-dist-$DS_VERSION.zip > $VEN_DIR/$DS_ZIP_NAME && unzip -o $VEN_DIR/$DS_ZIP_NAME -d $DS_UNZIP_DIR && rm $VEN_DIR/$DS_ZIP_NAME && rm $DS_UNZIP_DIR/version-release-notes-*.* && rm -rf $DS_UNZIP_DIR/html-samples && rm $DS_UNZIP_DIR/index.html && rm $DS_UNZIP_DIR/package.json && rm -rf $DS_UNZIP_DIR/styles/components && rm -rf $DS_UNZIP_DIR/styles/sass && rm -rf $DS_UNZIP_DIR/fonts/ds-fonts.zip"
15+
},
16+
"author": "",
17+
"license": "",
18+
"devDependencies": {
19+
"@11ty/eleventy": "^1.0.1",
20+
"commander": "^9.3.0",
21+
"dotenv": "^16.0.0",
22+
"fs-extra": "^10.1.0",
23+
"html-validate": "^6.1.0",
24+
"inquirer": "^9.0.0",
25+
"mocha": "^9.1.3",
26+
"prettier": "2.6.2",
27+
"simple-git": "^3.10.0",
28+
"uuid": "^8.3.2",
29+
"validate-npm-package-name": "^4.0.0"
30+
}
31+
}

0 commit comments

Comments
 (0)