Skip to content

Commit

Permalink
added watch task in dev mode, had to rename files to mjs so that elev…
Browse files Browse the repository at this point in the history
…enty doesnt get confused
  • Loading branch information
wolulcmit committed May 15, 2024
1 parent 70f82c8 commit 0fe4c55
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 0 deletions.
20 changes: 20 additions & 0 deletions eleventy.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Eleventy 3!
import pluginWebc from "npm:@11ty/eleventy-plugin-webc";
import { EleventyRenderPlugin } from "npm:@11ty/eleventy@canary";

export default function(eleventyConfig) {

eleventyConfig.addPassthroughCopy("./src/css/*.css");
eleventyConfig.addPlugin(EleventyRenderPlugin);
eleventyConfig.addPlugin(pluginWebc,{
components: "src/_includes/webc/**/*.webc",
});

return {
htmlTemplateEngine: "njk",
dir: {
input: "src",
output: "_site"
}
}
};
3 changes: 3 additions & 0 deletions src/_data/likes.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
likes: 0
}
9 changes: 9 additions & 0 deletions src/_data/meta.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default {
// NOTE: `process.env.URL` is provided by Netlify, and may need
// adjusted pending your host
url: Deno.env.get("Host") || "http://localhost:8080",
siteName: "11ty deno htmx",
siteDescription: "",
authorName: "",
twitterUsername: "", // no `@`
};
16 changes: 16 additions & 0 deletions src/content/content.11tydata.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const environmentVars = () => {
if ( Deno.env.get("LAYOUT") === "slim"){
return {
layout: "nolayout.njk",
permalink: "/{{ title | slugify }}/slim.html"
}
}
else {
return {
layout: "layout.njk",
permalink: "/{{ title | slugify }}/"
}
}
};

export default environmentVars
16 changes: 16 additions & 0 deletions src/src.11tydata.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const environmentVars = () => {
if ( Deno.env.get("LAYOUT") === "slim"){
return {
layout: "nolayout.njk",
permalink: "/slim.html"
}
}
else {
return {
layout: "layout.njk",
permalink: "/"
}
}
};

export default environmentVars

0 comments on commit 0fe4c55

Please sign in to comment.