Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _data/metadata.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
title: "Nami Writes - Nami's Blog",
url: "https://blog.namisunami.com/",
language: "en",
Expand Down
2 changes: 1 addition & 1 deletion content/blog/blog.11tydata.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
tags: ["posts"],
layout: "layouts/post.njk",
};
3 changes: 0 additions & 3 deletions content/feed/feed.11tydata.js

This file was deleted.

33 changes: 0 additions & 33 deletions content/feed/feed.njk

This file was deleted.

29 changes: 0 additions & 29 deletions content/feed/json.njk

This file was deleted.

89 changes: 89 additions & 0 deletions content/feed/pretty-atom-feed.xsl

Large diffs are not rendered by default.

37 changes: 35 additions & 2 deletions eleventy.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DateTime } from "luxon";
import markdownItAnchor from "markdown-it-anchor";

import pluginRss from "@11ty/eleventy-plugin-rss";
import { feedPlugin } from "@11ty/eleventy-plugin-rss";
import pluginSyntaxHighlight from "@11ty/eleventy-plugin-syntaxhighlight";
import pluginBundle from "@11ty/eleventy-plugin-bundle";
import pluginNavigation from "@11ty/eleventy-navigation";
Expand Down Expand Up @@ -29,7 +29,6 @@ export default function (eleventyConfig) {
eleventyConfig.addPlugin(pluginDrafts);

// Official plugins
eleventyConfig.addPlugin(pluginRss);
eleventyConfig.addPlugin(pluginSyntaxHighlight, {
preAttributes: { tabindex: 0 },
});
Expand Down Expand Up @@ -116,6 +115,40 @@ export default function (eleventyConfig) {

// eleventyConfig.setServerPassthroughCopyBehavior("passthrough");

// Feed plugin
eleventyConfig.addPlugin(feedPlugin, {
type: "atom", // or "rss", "json"
outputPath: "/feed/feed.xml",
stylesheet: "pretty-atom-feed.xsl",
templateData: {
eleventyNavigation: {
key: "Feed",
order: 4,
},
},
collection: {
name: "posts",
limit: 10,
},
metadata: {
language: "en",
title: "Nami Writes",
subtitle: "Nami's blog",
base: "https://blog.namisunami.com/",
author: {
name: "Nami Sunami",
},
},
});

// Copy the contents of the `public` folder to the output folder
// For example, `./public/css/` ends up in `_site/css/`
eleventyConfig
.addPassthroughCopy({
"./public/": "/",
})
.addPassthroughCopy("./content/feed/pretty-atom-feed.xsl");

return {
// Control which files Eleventy will process
// e.g.: *.md, *.njk, *.html, *.liquid
Expand Down
72 changes: 22 additions & 50 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@11ty/eleventy-img": "^6.0.1",
"@11ty/eleventy-navigation": "^0.3.5",
"@11ty/eleventy-plugin-bundle": "^1.0.4",
"@11ty/eleventy-plugin-rss": "^1.2.0",
"@11ty/eleventy-plugin-rss": "^2.0.4",
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0",
"luxon": "^3.3.0",
"markdown-it-anchor": "^8.6.7"
Expand Down