diff options
Diffstat (limited to 'src/skaldpress/metadata_parser.rs')
-rw-r--r-- | src/skaldpress/metadata_parser.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/skaldpress/metadata_parser.rs b/src/skaldpress/metadata_parser.rs index a2abcc2..66a96b6 100644 --- a/src/skaldpress/metadata_parser.rs +++ b/src/skaldpress/metadata_parser.rs @@ -4,7 +4,7 @@ use std::cmp::Ordering; use std::collections::HashMap; use std::fmt; -#[derive(Eq, PartialEq, Debug)] +#[derive(Clone, Eq, PartialEq, Debug)] pub enum YamlValue { Scalar(String), Integer(i64), @@ -130,5 +130,11 @@ pub fn extract_parse_yaml_metadata<'a>( end_index = markdown.len(); } + if let Some(publish_date) = yaml_map.get("publish_date") { + if !yaml_map.contains_key("change_date") { + yaml_map.insert("change_date".to_string(), publish_date.clone()); + } + } + Some((yaml_map, &markdown[end_index..])) } |