Skip to content
Merged
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
44 changes: 21 additions & 23 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,31 @@ const yaml = require('js-yaml');
const navigationPlugin = require('@11ty/eleventy-navigation');
const path = require('path');

// Generate the shortened commit hash and create (overwrite) `build_info.json`
// file. This file will eventually be added to the footer of the page.
const writeBuildInfoToFile = () => {
const version = require('./package.json').version;
const commitHash = require('child_process')
.execSync('git rev-parse --short HEAD').toString().trim();
const commitDate = require('child_process')
.execSync('git show -s --format=%cd --date=short').toString().trim();
const currentYear = (new Date()).getFullYear();
const jsonData = JSON.stringify({
version: version,
revision: commitHash,
lastUpdated: commitDate,
copyrightYear: currentYear
module.exports = function (eleventyConfig) {
eleventyConfig.addGlobalData('build_info', () => {
const version = require('./package.json').version;
const commitHash = require('child_process')
.execSync('git rev-parse --short HEAD')
.toString()
.trim();
const commitDate = require('child_process')
.execSync('git show -s --format=%cd --date=short')
.toString()
.trim();
const currentYear = new Date().getFullYear();
return {
version: version,
revision: commitHash,
lastUpdated: commitDate,
copyrightYear: currentYear,
};
});
const fs = require('fs');
fs.writeFileSync('src/_data/build_info.json', jsonData);
};

module.exports = function(eleventyConfig) {
writeBuildInfoToFile();

// See .eleventyignore for files to ignore.
eleventyConfig.setUseGitIgnore(false);

// To enable YAML files in `_data`.
eleventyConfig.addDataExtension('yaml', contents => yaml.load(contents));
eleventyConfig.addDataExtension('yaml', (contents) => yaml.load(contents));

// To handle relative paths and basic navigation via breadcrumbs.
eleventyConfig.addPlugin(navigationPlugin);
Expand Down Expand Up @@ -82,11 +80,11 @@ module.exports = function(eleventyConfig) {
'src/sitemap.xml',
'src/lib/**/*.js',
'src/lib/**/*.html',
].map(path => eleventyConfig.addPassthroughCopy(path));
].map((path) => eleventyConfig.addPassthroughCopy(path));

// eleventyConfig.addPassthroughCopy('src/favicon');

return {
dir: {input: 'src'}
dir: { input: 'src' },
};
};
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
if [ -n "$FILES" ]; then
echo "Linting changed files:"
echo "$FILES"
echo "$FILES" | xargs npx prettier --check
echo "$FILES" | grep -E '\.(js|jsx|ts|tsx)$' | xargs npx eslint || true
else
echo "No relevant files changed."
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
.vscode/
node_modules/
_site/

Expand Down
10 changes: 0 additions & 10 deletions .prettierrc.json

This file was deleted.

Loading