Skip to content

Commit

Permalink
initial commit for v3
Browse files Browse the repository at this point in the history
  • Loading branch information
hoch committed Apr 29, 2022
0 parents commit 7b7d2db
Show file tree
Hide file tree
Showing 15 changed files with 9,086 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
const htmlmin = require('html-minifier');

// 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
});
const fs = require('fs');
fs.writeFileSync('src/_data/build_info.json', jsonData);
};

const htmlMinifierCallback = (content, outputPath) => {
if (outputPath.endsWith('.html')) {
let minified = htmlmin.minify(content, {
useShortDoctype: true,
removeComments: true,
collapseWhitespace: true,
});
return minified;
}
return content;
};

module.exports = function(eleventyConfig) {
eleventyConfig.setUseGitIgnore(false);

writeBuildInfoToFile();

if (process.env.ELEVENTY_ENV === 'production') {
eleventyConfig.addTransform('htmlminifier', htmlMinifierCallback);
} else {
eleventyConfig.setBrowserSyncConfig({});
}

// eleventyConfig.addWatchTarget('./scripts/*.js');
eleventyConfig.addWatchTarget('./src/styles/styles.css');

// eleventyConfig.addPassthroughCopy('src/scripts');
eleventyConfig.addPassthroughCopy('src/style.css');
// eleventyConfig.addPassthroughCopy('src/media');
// eleventyConfig.addPassthroughCopy('src/favicon');
// eleventyConfig.addPassthroughCopy('src/robots.txt');
// eleventyConfig.addPassthroughCopy('src/sitemap.xml');

return {
dir: {input: 'src'}
};
};
2 changes: 2 additions & 0 deletions .eleventyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
README.md
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.DS_Store
node_modules/
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Package Maintenance (04/29/2022)

brew doctor
brew update --verbose
brew upgrade
brew doctor && brew cleanup
Loading

0 comments on commit 7b7d2db

Please sign in to comment.