Browse Source

Merge pull request #164 from jeffparsons/expose_page_draft_variable

Expose to templates whether or not a page is draft
index-subcmd
Vincent Prouillet GitHub 7 years ago
parent
commit
4783782798
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      components/content/src/page.rs

+ 2
- 1
components/content/src/page.rs View File

@@ -203,7 +203,7 @@ impl Default for Page {

impl ser::Serialize for Page {
fn serialize<S>(&self, serializer: S) -> StdResult<S::Ok, S::Error> where S: ser::Serializer {
let mut state = serializer.serialize_struct("page", 17)?;
let mut state = serializer.serialize_struct("page", 18)?;
state.serialize_field("content", &self.content)?;
state.serialize_field("title", &self.meta.title)?;
state.serialize_field("description", &self.meta.description)?;
@@ -222,6 +222,7 @@ impl ser::Serialize for Page {
state.serialize_field("previous", &self.previous)?;
state.serialize_field("next", &self.next)?;
state.serialize_field("toc", &self.toc)?;
state.serialize_field("draft", &self.is_draft())?;
state.end()
}
}


Loading…
Cancel
Save