other improvements
This commit is contained in:
parent
c77c028404
commit
29f93a9e6f
23 changed files with 448 additions and 103 deletions
29
.eleventy.js
29
.eleventy.js
|
@ -1,9 +1,28 @@
|
|||
const pluginRev = require("eleventy-plugin-rev");
|
||||
const eleventySass = require("eleventy-sass");
|
||||
const tinyHTML = require('@sardine/eleventy-plugin-tinyhtml');
|
||||
const eleventyNavigationPlugin = require("@11ty/eleventy-navigation");
|
||||
|
||||
module.exports = function (eleventyConfig) {
|
||||
eleventyConfig.addWatchTarget("./src/scss/");
|
||||
|
||||
eleventyConfig.addPlugin(pluginRev);
|
||||
eleventyConfig.addPlugin(tinyHTML);
|
||||
eleventyConfig.addPlugin(eleventySass, {
|
||||
sass: {
|
||||
loadPaths: ["node_modules"],
|
||||
style: "compressed",
|
||||
sourceMap: false,
|
||||
},
|
||||
compileOptions: {
|
||||
permalink: function (contents, inputPath) {
|
||||
return (data) => {
|
||||
return data.page.filePathStem.replace(/^\/scss\//, "/css/") + ".css";
|
||||
};
|
||||
}
|
||||
},
|
||||
rev: true
|
||||
});
|
||||
eleventyConfig.addPlugin(eleventyNavigationPlugin);
|
||||
|
||||
eleventyConfig.setUseGitIgnore(false);
|
||||
eleventyConfig.addPassthroughCopy({
|
||||
"src/img": "img",
|
||||
|
@ -19,7 +38,7 @@ module.exports = function (eleventyConfig) {
|
|||
});
|
||||
|
||||
eleventyConfig.addFilter("sum", function (value) {
|
||||
return value.map(d => d.amount).reduce((a, b) => a + b);
|
||||
return value.map(d => d.amount).reduce((a, b) => a + b, 0);
|
||||
});
|
||||
|
||||
eleventyConfig.addFilter("amount", function (value) {
|
||||
|
@ -43,6 +62,10 @@ module.exports = function (eleventyConfig) {
|
|||
.length;
|
||||
});
|
||||
|
||||
eleventyConfig.addFilter('getServiceById', (services, serviceId) => {
|
||||
return services.find(s => s.id === serviceId);
|
||||
});
|
||||
|
||||
return {
|
||||
// Pre-process *.md files with: (default: `liquid`)
|
||||
markdownTemplateEngine: "njk",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue