From 64feaeb3eeeaf7758a0ee2529c6ea60e4fa608a5 Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Wed, 22 Feb 2023 22:20:40 +0100 Subject: [PATCH] Pass section.generate_feed --- CHANGELOG.md | 1 + components/content/src/ser.rs | 2 ++ docs/content/documentation/templates/pages-sections.md | 2 ++ 3 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d3ab895..583c3bf4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 0.17.1 (unreleased) - Fix bugs with colocated directories in the root `content` directory +- Add `generate_feed` field to the `section` object in templates ## 0.17.0 (2023-02-16) diff --git a/components/content/src/ser.rs b/components/content/src/ser.rs index ebc193ef..18e175f1 100644 --- a/components/content/src/ser.rs +++ b/components/content/src/ser.rs @@ -160,6 +160,7 @@ pub struct SerializingSection<'a> { subsections: Vec<&'a str>, translations: Vec>, backlinks: Vec>, + generate_feed: bool, } #[derive(Debug)] @@ -218,6 +219,7 @@ impl<'a> SerializingSection<'a> { reading_time: section.reading_time, assets: §ion.serialized_assets, lang: §ion.lang, + generate_feed: section.meta.generate_feed, pages, subsections, translations, diff --git a/docs/content/documentation/templates/pages-sections.md b/docs/content/documentation/templates/pages-sections.md index 701cf03b..1b1b15ad 100644 --- a/docs/content/documentation/templates/pages-sections.md +++ b/docs/content/documentation/templates/pages-sections.md @@ -107,6 +107,8 @@ lang: String; translations: Array; // All the pages/sections linking this page: their permalink and a title if there is one backlinks: Array<{permalink: String, title: String?}>; +// Whether this section generates a feed or not. Taken from the front-matter if set +generate_feed: bool; ``` ## Table of contents