From 17850ae636c637b7c26bc7320c9036d4b108d416 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 24 Jan 2024 12:40:14 +0100 Subject: [PATCH] alphabetical order --- src/misc/markdown.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/misc/markdown.rs b/src/misc/markdown.rs index 27c16f4..49e077f 100644 --- a/src/misc/markdown.rs +++ b/src/misc/markdown.rs @@ -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()