alphabetical order
This commit is contained in:
parent
978cc48a57
commit
17850ae636
1 changed files with 7 additions and 7 deletions
|
@ -60,9 +60,9 @@ pub struct FileMetadataPortfolio {
|
|||
|
||||
/// List of available metadata types
|
||||
pub enum TypeFileMetadata {
|
||||
Generic,
|
||||
Blog,
|
||||
Contact,
|
||||
Generic,
|
||||
Portfolio,
|
||||
}
|
||||
|
||||
|
@ -226,9 +226,6 @@ pub fn get_metadata<'a>(root: &'a AstNode<'a>, mtype: TypeFileMetadata) -> FileM
|
|||
.find_map(|node| match &node.data.borrow().value {
|
||||
// Extract metadata from frontmatter
|
||||
NodeValue::FrontMatter(text) => Some(match mtype {
|
||||
TypeFileMetadata::Generic => FileMetadata {
|
||||
..FileMetadata::default()
|
||||
},
|
||||
TypeFileMetadata::Blog => FileMetadata {
|
||||
blog: Some(deserialize_metadata(text)),
|
||||
..FileMetadata::default()
|
||||
|
@ -246,6 +243,9 @@ pub fn get_metadata<'a>(root: &'a AstNode<'a>, mtype: TypeFileMetadata) -> FileM
|
|||
..FileMetadata::default()
|
||||
}
|
||||
}
|
||||
TypeFileMetadata::Generic => FileMetadata {
|
||||
..FileMetadata::default()
|
||||
},
|
||||
TypeFileMetadata::Portfolio => FileMetadata {
|
||||
portfolio: Some(deserialize_metadata(text)),
|
||||
..FileMetadata::default()
|
||||
|
@ -256,9 +256,6 @@ pub fn get_metadata<'a>(root: &'a AstNode<'a>, mtype: TypeFileMetadata) -> FileM
|
|||
Some(data) => data,
|
||||
// No metadata
|
||||
None => match mtype {
|
||||
TypeFileMetadata::Generic => FileMetadata {
|
||||
..FileMetadata::default()
|
||||
},
|
||||
TypeFileMetadata::Blog => FileMetadata {
|
||||
blog: Some(FileMetadataBlog::default()),
|
||||
..FileMetadata::default()
|
||||
|
@ -267,6 +264,9 @@ pub fn get_metadata<'a>(root: &'a AstNode<'a>, mtype: TypeFileMetadata) -> FileM
|
|||
contact: Some(FileMetadataContact::default()),
|
||||
..FileMetadata::default()
|
||||
},
|
||||
TypeFileMetadata::Generic => FileMetadata {
|
||||
..FileMetadata::default()
|
||||
},
|
||||
TypeFileMetadata::Portfolio => FileMetadata {
|
||||
portfolio: Some(FileMetadataPortfolio::default()),
|
||||
..FileMetadata::default()
|
||||
|
|
Loading…
Reference in a new issue