Phase 4: implement full static site (Eleventy, 15 pages, CSS, JS)
This commit is contained in:
28
.eleventy.js
Normal file
28
.eleventy.js
Normal file
@@ -0,0 +1,28 @@
|
||||
module.exports = function (eleventyConfig) {
|
||||
// Pass static assets through to _site/
|
||||
eleventyConfig.addPassthroughCopy("src/css");
|
||||
eleventyConfig.addPassthroughCopy("src/js");
|
||||
eleventyConfig.addPassthroughCopy({ "assets": "assets" });
|
||||
|
||||
// Format phone number as a tel: href (strips everything but digits and +)
|
||||
eleventyConfig.addFilter("telHref", (phone) =>
|
||||
"tel:" + phone.replace(/[^0-9+]/g, "")
|
||||
);
|
||||
|
||||
// Current year for footer copyright
|
||||
eleventyConfig.addFilter("currentYear", () =>
|
||||
new Date().getFullYear()
|
||||
);
|
||||
|
||||
return {
|
||||
templateFormats: ["njk", "html", "xml", "txt"],
|
||||
htmlTemplateEngine: "njk",
|
||||
markdownTemplateEngine: "njk",
|
||||
dir: {
|
||||
input: "src",
|
||||
output: "_site",
|
||||
includes: "_includes",
|
||||
data: "_data",
|
||||
},
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user