From f11cc6abb47076d8b26b5d7a340f1323ae15eddb Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Tue, 26 Sep 2017 17:21:08 +0900 Subject: [PATCH] Serialize page & section paths is, without leading slash --- components/content/src/page.rs | 2 +- components/content/src/section.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/content/src/page.rs b/components/content/src/page.rs index 7d37cc8..6f0ad10 100644 --- a/components/content/src/page.rs +++ b/components/content/src/page.rs @@ -191,7 +191,7 @@ impl ser::Serialize for Page { state.serialize_field("description", &self.meta.description)?; state.serialize_field("date", &self.meta.date)?; 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("summary", &self.summary)?; state.serialize_field("tags", &self.meta.tags)?; diff --git a/components/content/src/section.rs b/components/content/src/section.rs index 8ce0ea5..54e749f 100644 --- a/components/content/src/section.rs +++ b/components/content/src/section.rs @@ -145,7 +145,7 @@ impl ser::Serialize for Section { state.serialize_field("title", &self.meta.title)?; state.serialize_field("description", &self.meta.description)?; 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("pages", &self.pages)?; state.serialize_field("subsections", &self.subsections)?;