Skip to content

Commit

Permalink
feat: link to issues from SC table (resolves #75) (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
greatislander authored Jul 4, 2024
1 parent d8b2adb commit a41107b
Show file tree
Hide file tree
Showing 12 changed files with 254 additions and 301 deletions.
21 changes: 13 additions & 8 deletions eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ export default function eleventy(eleventyConfig) {
eleventyConfig.addPlugin(EleventyRenderPlugin);
eleventyConfig.addPlugin(syntaxHighlightPlugin);

// eslint-disable-next-line prefer-arrow-callback
eleventyConfig.addAsyncFilter('formatDate', function (value) {
return new Date(value).toLocaleString('en-CA', {year: 'numeric', month: 'long', day: 'numeric'});
});
eleventyConfig.addAsyncFilter('formatDate', value => new Date(value).toLocaleString('en-CA', {
year: 'numeric',
month: 'long',
day: 'numeric',
}));

eleventyConfig.addCollection('issues', collectionApi =>
collectionApi
.getFilteredByGlob('src/report/issues/*.md')
.filter(
item =>
!(item.data.sc === undefined) && (item.data.sc.length > 0),
item => !(item.data.sc === undefined) && item.data.sc.length > 0,
)
.sort((a, b) => {
const sortCriterionA = a.data.sc.sort()[0];
Expand All @@ -50,7 +50,9 @@ export default function eleventy(eleventyConfig) {
eleventyConfig.addCollection('tips', collectionApi =>
collectionApi
.getFilteredByGlob('src/report/issues/*.md')
.filter(item => item.data.sc === undefined || item.data.sc.length === 0),
.filter(
item => item.data.sc === undefined || item.data.sc.length === 0,
),
);

eleventyConfig.addPassthroughCopy({
Expand All @@ -62,7 +64,10 @@ export default function eleventy(eleventyConfig) {
});

eleventyConfig.addPassthroughCopy({
'node_modules/a11y-syntax-highlighting/dist/prism/a11y-dark.min.css': 'assets/styles/a11y-dark.min.css',
'node_modules/a11y-syntax-highlighting/dist/prism/a11y-dark.min.css':
'assets/styles/a11y-dark.min.css',
'node_modules/@zachleat/table-saw/table-saw.js':
'assets/scripts/table-saw.js',
});

return {
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@11ty/eleventy": "3.0.0-alpha.14",
"@11ty/eleventy-fetch": "^4.0.1",
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0",
"@zachleat/table-saw": "^1.0.6",
"a11y-syntax-highlighting": "^0.2.0",
"new-github-issue-url": "^1.0.0"
},
Expand Down
Loading

0 comments on commit a41107b

Please sign in to comment.