From 83ec0fb415ee8b16c5e928d2a9b6366ef4f10aaa Mon Sep 17 00:00:00 2001 From: Nathaniel Rook Date: Sun, 26 Mar 2023 14:51:10 -0400 Subject: [PATCH] Update and style blog. It's still very rudimentary, but now there's enough there that it's feasible to post new content. --- .eleventy.js | 17 ++++++++++ _data/site_info.js | 4 +++ _includes/layouts/base.njk | 15 ++++----- _includes/layouts/post.njk | 6 +--- content/feed.njk | 34 +++++++++++++++++++ content/{index.md => index.html} | 4 +++ content/main.sass | 24 +++++++++++++ package-lock.json | 58 +++++++++++++++++++++++++++++++- package.json | 3 +- 9 files changed, 149 insertions(+), 16 deletions(-) create mode 100644 _data/site_info.js create mode 100644 content/feed.njk rename content/{index.md => index.html} (66%) create mode 100644 content/main.sass diff --git a/.eleventy.js b/.eleventy.js index 710613f..7b30388 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -5,6 +5,7 @@ const pluginRss = require("@11ty/eleventy-plugin-rss"); const pluginBundle = require("@11ty/eleventy-plugin-bundle"); const pluginNavigation = require("@11ty/eleventy-navigation"); const eleventy = require("@11ty/eleventy"); +const sass = require("sass"); // Thanks to https://github.com/11ty/eleventy-base-blog // for providing a lot of inspiration! @@ -26,10 +27,24 @@ module.exports = function(config) { return DateTime.fromJSDate(dateObj, {zone: 'utc'}).toFormat('yyyy-LL-dd'); }); + config.addExtension("sass", { + outputFileExtension: "css", + + compile: async function(inputContent) { + const result = sass.compileString( + inputContent, + { + syntax: 'indented' + }); + return async (data) => result.css; + } + }); + return { dir: { input: "content", includes: "../_includes", + data: "../_data", output: "_site", }, @@ -37,6 +52,8 @@ module.exports = function(config) { htmlTemplateEngine: "njk", + templateFormats: ["html", "md", "njk", "sass"], + pathPrefix: "/", } } diff --git a/_data/site_info.js b/_data/site_info.js new file mode 100644 index 0000000..efbb33a --- /dev/null +++ b/_data/site_info.js @@ -0,0 +1,4 @@ +module.exports = { + title: 'Silent Selene Blog', + description: 'Keep up with Silent Selene news and new features.' +} diff --git a/_includes/layouts/base.njk b/_includes/layouts/base.njk index 702d04c..093e4e9 100644 --- a/_includes/layouts/base.njk +++ b/_includes/layouts/base.njk @@ -1,25 +1,22 @@ - + - {{ title or metadata.title }} - + {{ title or site_info.title }} + - - + - - +
- {{ metadata.title }} + {{ site_info.title }}