From 46de52e502c51c6f525fe5318a29a7c4c23f06b9 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 19 Mar 2018 08:53:18 -0600 Subject: [PATCH] feat(liquid): Add page.slug This was removed in #257 because it was deemed as not being needed but a use case was found in #384. I'm not fully convinced about that use case but I feel there are probably others, like in having an identifier to use in creating a table of contents. Fixed #384 --- src/document.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/document.rs b/src/document.rs index 51de9e0..525add5 100644 --- a/src/document.rs +++ b/src/document.rs @@ -166,6 +166,7 @@ fn document_attributes( let attributes = vec![ ("permalink".to_owned(), liquid::Value::scalar(url_path)), ("title".to_owned(), liquid::Value::scalar(&front.title)), + ("slug".to_owned(), liquid::Value::scalar(&front.slug)), ( "description".to_owned(), liquid::Value::scalar(front.description.as_ref().map(|s| s.as_str()).unwrap_or("")),