Include now entries in main RSS feed
This commit is contained in:
@@ -10,11 +10,7 @@ import pluginBundle from "@11ty/eleventy-plugin-bundle";
|
||||
import pluginNavigation from "@11ty/eleventy-navigation";
|
||||
import prettier from "prettier";
|
||||
import { EleventyHtmlBasePlugin } from "@11ty/eleventy";
|
||||
import {
|
||||
dateSuffixAdder,
|
||||
monthMap,
|
||||
timeFormatter,
|
||||
} from "./public/js/modules/dateTools.js";
|
||||
import { dateSuffixAdder, monthMap } from "./public/js/modules/dateTools.js";
|
||||
|
||||
const figoptions = {
|
||||
figcaption: true,
|
||||
@@ -24,14 +20,6 @@ const timeZone = "America/Chicago";
|
||||
|
||||
export default async function (eleventyConfig) {
|
||||
// Helper Functions
|
||||
const multiReplace = (text, replacementTable) => {
|
||||
let newText = text;
|
||||
replacementTable.forEach((x) => {
|
||||
newText = newText.replace(x[0], x[1]);
|
||||
});
|
||||
return newText;
|
||||
};
|
||||
|
||||
eleventyConfig.addDateParsing((dateValue) => {
|
||||
let localDate;
|
||||
if (dateValue instanceof Date) {
|
||||
@@ -69,6 +57,15 @@ export default async function (eleventyConfig) {
|
||||
return galleryImages;
|
||||
});
|
||||
|
||||
eleventyConfig.addCollection("feed", async (collectionApi) => {
|
||||
return [
|
||||
...collectionApi.getFilteredByTag("posts"),
|
||||
...collectionApi.getFilteredByTag("now"),
|
||||
].sort(function (a, b) {
|
||||
return b.date - a.date;
|
||||
});
|
||||
});
|
||||
|
||||
// Transforms
|
||||
eleventyConfig.addTransform("prettier", function (content, outputPath) {
|
||||
if (outputPath && outputPath.endsWith(".html")) {
|
||||
|
||||
Reference in New Issue
Block a user