mirror of
https://github.com/cobalt-org/cobalt.rs
synced 2024-11-14 16:07:22 +00:00
feat: Support :categories
in permalink
This commit is contained in:
parent
ee10453bb3
commit
a9b4474fdf
1 changed files with 4 additions and 0 deletions
|
@ -12,6 +12,7 @@ use jsonfeed;
|
|||
use jsonfeed::Item;
|
||||
use jsonfeed::Content;
|
||||
use serde_yaml;
|
||||
use itertools;
|
||||
|
||||
#[cfg(all(feature="syntax-highlight", not(windows)))]
|
||||
use syntax_highlight::{initialize_codeblock, decorate_markdown};
|
||||
|
@ -98,6 +99,9 @@ fn permalink_attributes(front: &frontmatter::Frontmatter,
|
|||
|
||||
attributes.insert(":slug".to_owned(), front.slug.clone());
|
||||
|
||||
attributes.insert(":categories".to_owned(),
|
||||
itertools::join(front.categories.iter(), "/"));
|
||||
|
||||
attributes.insert(":output_ext".to_owned(), ".html".to_owned());
|
||||
|
||||
if let Some(ref date) = front.published_date {
|
||||
|
|
Loading…
Reference in a new issue