summaryrefslogtreecommitdiffstats
path: root/eleventy.config.js
diff options
context:
space:
mode:
author2024-04-07 19:43:04 +0530
committer2024-04-07 19:43:04 +0530
commit900a707fdcb04e5739126ec2509fdc39fee7491c (patch)
tree427c9155bcbcca013f4c352888d8d88984e4e027 /eleventy.config.js
parent0.5.1 (diff)
downloadsudomsg-900a707fdcb04e5739126ec2509fdc39fee7491c.tar
sudomsg-900a707fdcb04e5739126ec2509fdc39fee7491c.tar.gz
sudomsg-900a707fdcb04e5739126ec2509fdc39fee7491c.tar.bz2
sudomsg-900a707fdcb04e5739126ec2509fdc39fee7491c.tar.lz
sudomsg-900a707fdcb04e5739126ec2509fdc39fee7491c.tar.xz
sudomsg-900a707fdcb04e5739126ec2509fdc39fee7491c.tar.zst
sudomsg-900a707fdcb04e5739126ec2509fdc39fee7491c.zip
Rewrote Site in 11ty
Still need to Update the content
Diffstat (limited to 'eleventy.config.js')
-rw-r--r--eleventy.config.js56
1 files changed, 56 insertions, 0 deletions
diff --git a/eleventy.config.js b/eleventy.config.js
new file mode 100644
index 0000000..edfa2f2
--- /dev/null
+++ b/eleventy.config.js
@@ -0,0 +1,56 @@
+import { EleventyHtmlBasePlugin, RenderPlugin, InputPathToUrlTransformPlugin } from '@11ty/eleventy';
+import syntaxHighlightPlugin from "@11ty/eleventy-plugin-syntaxhighlight";
+import rssPlugin from "@11ty/eleventy-plugin-rss";
+import eleventyNavigationPlugin from "@11ty/eleventy-navigation";
+import directoryOutputPlugin from "@11ty/eleventy-plugin-directory-output";
+import { eleventyImageTransformPlugin } from "@11ty/eleventy-img";
+import pluginWebc from "@11ty/eleventy-plugin-webc";
+
+import { DateTime } from "luxon";
+
+export default async function(eleventyConfig) {
+ eleventyConfig.addPlugin(EleventyHtmlBasePlugin);
+ eleventyConfig.addPlugin(RenderPlugin);
+ eleventyConfig.addPlugin(InputPathToUrlTransformPlugin);
+ eleventyConfig.addPlugin(syntaxHighlightPlugin);
+ eleventyConfig.addPlugin(rssPlugin);
+ eleventyConfig.addPlugin(eleventyNavigationPlugin);
+
+ eleventyConfig.addPlugin(directoryOutputPlugin);
+
+ eleventyConfig.addPlugin(pluginWebc);
+
+ eleventyConfig.addPlugin(eleventyImageTransformPlugin, {
+ extensions: "html",
+ formats: ["webp", "jpeg", "svg", "avif", "auto", "png"],
+ defaultAttributes: {
+ loading: "lazy",
+ decoding: "async",
+ },
+ });
+
+ eleventyConfig.setServerPassthroughCopyBehavior("passthrough");
+
+ eleventyConfig.addPassthroughCopy({
+ "./public/": "/",
+ });
+
+ eleventyConfig.addFilter("readableDate", (dateObj, format, zone) => {
+ return DateTime.fromJSDate(dateObj, { zone: zone || "utc" }).toFormat(format || "dd LLLL yyyy");
+ });
+
+ eleventyConfig.addFilter('htmlDateString', (dateObj) => {
+ return DateTime.fromJSDate(dateObj, { zone: 'utc' }).toFormat('yyyy-LL-dd');
+ });
+
+ eleventyConfig.addShortcode('schema', (type) => {
+ return (type instanceof URL ? type : new URL(type, "http://schema.org/")).href;
+ });
+
+ eleventyConfig.setQuietMode(true);
+
+ return {
+ markdownTemplateEngine: "njk",
+ htmlTemplateEngine: "njk",
+ }
+}