Skip to content

Commit 44674cd

Browse files
committed
Include unrendered pages in sections, add render property to templates
1 parent ce10aae commit 44674cd

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

components/content/src/library.rs

-3
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,6 @@ impl Library {
295295

296296
// Then once we took care of the sections, we find the pages of each section
297297
for (path, page) in self.pages.iter_mut() {
298-
if !page.meta.render {
299-
continue;
300-
}
301298
let parent_filename = &index_filename_by_lang[&page.lang];
302299
add_translation(&page.file.canonical, path);
303300
let mut parent_section_path = page.file.parent.join(parent_filename);

components/content/src/ser.rs

+4
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ pub struct SerializingPage<'a> {
6464
word_count: Option<usize>,
6565
reading_time: Option<usize>,
6666
assets: &'a [String],
67+
render: bool,
6768
draft: bool,
6869
lang: &'a str,
6970
lower: Option<Box<SerializingPage<'a>>>,
@@ -128,6 +129,7 @@ impl<'a> SerializingPage<'a> {
128129
word_count: page.word_count,
129130
reading_time: page.reading_time,
130131
assets: &page.serialized_assets,
132+
render: page.meta.render,
131133
draft: page.meta.draft,
132134
lang: &page.lang,
133135
lower,
@@ -144,6 +146,7 @@ pub struct SerializingSection<'a> {
144146
colocated_path: &'a Option<String>,
145147
content: &'a str,
146148
permalink: &'a str,
149+
render: bool,
147150
draft: bool,
148151
ancestors: &'a [String],
149152
title: &'a Option<String>,
@@ -207,6 +210,7 @@ impl<'a> SerializingSection<'a> {
207210
relative_path: &section.file.relative,
208211
colocated_path: &section.file.colocated_path,
209212
ancestors: &section.ancestors,
213+
render: section.meta.render,
210214
draft: section.meta.draft,
211215
content: &section.content,
212216
permalink: &section.permalink,

docs/content/documentation/templates/pages-sections.md

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ updated: String?;
2323
slug: String;
2424
path: String;
2525
authors: Array<String>;
26+
render: Bool;
2627
draft: Bool;
2728
// the path, split on '/'
2829
components: Array<String>;
@@ -77,6 +78,8 @@ content: String;
7778
title: String?;
7879
description: String?;
7980
path: String;
81+
render: Bool;
82+
draft: Bool;
8083
// the path, split on '/'
8184
components: Array<String>;
8285
permalink: String;

0 commit comments

Comments
 (0)