From e184798c8d3af1db33800448404503951ef8b89e Mon Sep 17 00:00:00 2001 From: Marc Pervaz Boocha Date: Sat, 8 Jan 2022 17:38:59 +0530 Subject: some corrections --- src/assets/assets.11tydata.js | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 src/assets/assets.11tydata.js (limited to 'src/assets/assets.11tydata.js') diff --git a/src/assets/assets.11tydata.js b/src/assets/assets.11tydata.js new file mode 100644 index 0000000..3b540a5 --- /dev/null +++ b/src/assets/assets.11tydata.js @@ -0,0 +1,3 @@ +module.exports = { + "eleventyExcludeFromCollections": true +} \ No newline at end of file -- cgit v1.2.3-70-g09d2 From d78cd5bf9a9b0f5dc0e9f902a72184a83fc7d5a7 Mon Sep 17 00:00:00 2001 From: Marc Pervaz Boocha Date: Sat, 8 Jan 2022 19:24:29 +0530 Subject: fixed the asset folder permalink issues --- .eleventy.js | 11 ++++++++--- src/assets/assets.11tydata.js | 7 ++++++- src/assets/sw.11tydata.js | 4 ---- src/layouts/base.njk | 6 +++--- 4 files changed, 17 insertions(+), 11 deletions(-) delete mode 100644 src/assets/sw.11tydata.js (limited to 'src/assets/assets.11tydata.js') diff --git a/.eleventy.js b/.eleventy.js index eadd855..0c450ad 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -22,6 +22,9 @@ module.exports = eleventyConfig => { eleventyConfig.addExtension("css", { outputFileExtension: "css", + compileOptions: { + permalink: "raw" + }, compile: async(content, filename) => async data => { const css = await postcss() @@ -37,8 +40,11 @@ module.exports = eleventyConfig => { eleventyConfig.addExtension("mjs", { outputFileExtension: "js", - compile: (content, filename) => { - return async data => { + compileOptions: { + permalink: "raw" + }, + compile: (content, filename) => + async data => { const js = await babel.transformAsync(content, { presets: [ ["@babel/preset-env", { @@ -53,7 +59,6 @@ module.exports = eleventyConfig => { }) return js.code } - } }) diff --git a/src/assets/assets.11tydata.js b/src/assets/assets.11tydata.js index 3b540a5..6704307 100644 --- a/src/assets/assets.11tydata.js +++ b/src/assets/assets.11tydata.js @@ -1,3 +1,8 @@ +const path = require("path") + module.exports = { - "eleventyExcludeFromCollections": true + eleventyExcludeFromCollections: true, + eleventyComputed: { + permalink: data => data.permalink || `/${path.relative("/assets", data.page.filePathStem)}.${data.page.outputFileExtension}` + } } \ No newline at end of file diff --git a/src/assets/sw.11tydata.js b/src/assets/sw.11tydata.js deleted file mode 100644 index 4a20677..0000000 --- a/src/assets/sw.11tydata.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - dynamicPermalink: false, - permalink: "/sw.js" -} \ No newline at end of file diff --git a/src/layouts/base.njk b/src/layouts/base.njk index 879d2d5..8fd6def 100644 --- a/src/layouts/base.njk +++ b/src/layouts/base.njk @@ -19,9 +19,9 @@ - - {% if syntaxhighlight %}{% endif %} - + + {% if syntaxhighlight %}{% endif %} +
-- cgit v1.2.3-70-g09d2