feat: Remove nunjucks

- Remove all nunjucks templates, macros and partials
- Remove nunjucks config from eleventy
- Remove njk from template formats
This commit is contained in:
sthag 2026-03-12 20:23:17 +01:00
parent 95e0460325
commit a5bf80cb91
25 changed files with 3 additions and 724 deletions

View file

@ -14,20 +14,10 @@ export default async function (eleventyConfig) {
// trimTagRight : true,
});
eleventyConfig.setNunjucksEnvironmentOptions({
// throwOnUndefined: true,
trimBlocks: true
});
eleventyConfig.addGlobalData('permalink', () => {
return (data) => `${data.page.filePathStem}.${data.page.outputFileExtension}`;
});
let demoMode = false;
let pageBase = demoMode ? './demo/' : './';
eleventyConfig.addGlobalData('hippie', {
pageBase: pageBase,
brand: 'hippie',
titlePrefix: '',
titlePostfix: ' - HIPPIE',
@ -58,7 +48,7 @@ export default async function (eleventyConfig) {
return `<a id="${attrId}" class="${attrClass}" href="${target}">${text}</a>`;
});
eleventyConfig.addPairedShortcode("brand", function (content, attrClass = 'brand', direction = 'first') {
eleventyConfig.addPairedShortcode('brand', function (content, attrClass = 'brand', direction = 'first') {
const logo = `
<svg
width="100%"
@ -96,6 +86,7 @@ export default async function (eleventyConfig) {
`;
let output = '';
switch (direction) {
case 'first':
output = logo + `${content}`;
@ -109,11 +100,8 @@ export default async function (eleventyConfig) {
});
eleventyConfig.addPassthroughCopy({'source/art/images': 'art'});
eleventyConfig.addPassthroughCopy({'source/art/favicons/**/*.+(ico|png|svg)': '.'});
eleventyConfig.addPassthroughCopy({'source/code/**/*.js': 'js'});
eleventyConfig.addPassthroughCopy({'source/data/**/*.json': 'json'});
eleventyConfig.addPassthroughCopy('vendor');
@ -133,7 +121,7 @@ export default async function (eleventyConfig) {
includes: '../templates',
data: '../data'
},
templateFormats: ['html', 'liquid', 'njk', 'md']
templateFormats: ['html', 'liquid', 'md']
// pathPrefix: './demo/'
};
}