]> git.otsuka.systems Git - cotsuka.github.io/commitdiff
fix feed generation, use global data metadata
authorCameron Otsuka <cameron@otsuka.haus>
Tue, 30 Jul 2024 22:05:55 +0000 (15:05 -0700)
committerCameron Otsuka <cameron@otsuka.haus>
Tue, 30 Jul 2024 22:05:55 +0000 (15:05 -0700)
_data/metadata.json
eleventy.config.js

index 76714dfdc63ea3001e917f4f7763535875daa5b0..16c427da97d3e4b2ac72e69dd3b44b52b877467c 100644 (file)
@@ -1,7 +1,9 @@
 {
     "title": "Cameron Otsuka",
     "url": "https://otsuka.haus/",
+    "base": "https://otsuka.haus/",
     "language": "en",
+    "subtitle": "The collection of Cameron's thoughts.",
     "description": "The collection of Cameron's thoughts.",
     "author": {
         "name": "Cameron Otsuka",
index 02154ab01747fed9e1f1888531e12eaac8df4ce4..3ce4c9448953943ced425d6cb95b2767725e8613 100644 (file)
@@ -1,8 +1,9 @@
 const cleanCSS = require("clean-css");
 const { DateTime } = require("luxon");
-const eleventyFeedPlugin = require("@11ty/eleventy-plugin-rss");
+const { feedPlugin } = require("@11ty/eleventy-plugin-rss");
 const eleventyImagePlugin = require("@11ty/eleventy-img");
 const eleventySyntaxHighlightPlugin = require("@11ty/eleventy-plugin-syntaxhighlight");
+const globalMetadata = require("./_data/metadata.json");
 const path = require("path");
 
 function relativeToInputPath(inputPath, relativeFilePath) {
@@ -33,24 +34,14 @@ module.exports = function (eleventyConfig) {
                return DateTime.fromJSDate(dateObj, { zone: zone || "utc" }).toFormat(format || "dd LLLL yyyy");
        });
        eleventyConfig.addPassthroughCopy({ "./static/": "/" });
-       eleventyConfig.addPlugin(eleventyFeedPlugin, {
+       eleventyConfig.addPlugin(feedPlugin, {
                type: "atom",
                outputPath: "/feed.xml",
                collection: {
                        name: "articles",
                        limit: 10,
                },
-               metadata: {
-                       language: "en",
-                       title: "Cameron Otsuka",
-                       subtitle: "The collection of Cameron's thoughts.",
-                       base: "https://otsuka.haus/",
-                       author: {
-                               name: "Cameron Otsuka",
-                               email: "cameron@otsuka.haus",
-                               url: "https://otsuka.haus"
-                       }
-               }
+               metadata: globalMetadata,
        });
        eleventyConfig.addPlugin(eleventySyntaxHighlightPlugin);
        eleventyConfig.addShortcode("image", async function (src, alt) {