Serialize page & section paths is, without leading slash

This commit is contained in:
Vincent Prouillet 2017-09-26 17:21:08 +09:00
parent b248b03045
commit f11cc6abb4
2 changed files with 2 additions and 2 deletions

View file

@ -191,7 +191,7 @@ impl ser::Serialize for Page {
state.serialize_field("description", &self.meta.description)?; state.serialize_field("description", &self.meta.description)?;
state.serialize_field("date", &self.meta.date)?; state.serialize_field("date", &self.meta.date)?;
state.serialize_field("slug", &self.slug)?; state.serialize_field("slug", &self.slug)?;
state.serialize_field("path", &format!("/{}", self.path))?; state.serialize_field("path", &self.path)?;
state.serialize_field("permalink", &self.permalink)?; state.serialize_field("permalink", &self.permalink)?;
state.serialize_field("summary", &self.summary)?; state.serialize_field("summary", &self.summary)?;
state.serialize_field("tags", &self.meta.tags)?; state.serialize_field("tags", &self.meta.tags)?;

View file

@ -145,7 +145,7 @@ impl ser::Serialize for Section {
state.serialize_field("title", &self.meta.title)?; state.serialize_field("title", &self.meta.title)?;
state.serialize_field("description", &self.meta.description)?; state.serialize_field("description", &self.meta.description)?;
state.serialize_field("extra", &self.meta.extra)?; state.serialize_field("extra", &self.meta.extra)?;
state.serialize_field("path", &format!("/{}", self.path))?; state.serialize_field("path", &self.path)?;
state.serialize_field("permalink", &self.permalink)?; state.serialize_field("permalink", &self.permalink)?;
state.serialize_field("pages", &self.pages)?; state.serialize_field("pages", &self.pages)?;
state.serialize_field("subsections", &self.subsections)?; state.serialize_field("subsections", &self.subsections)?;