From cbaa4f603bc4653242a1545bcd595f3fafa9c9be Mon Sep 17 00:00:00 2001 From: Mar Date: Fri, 9 Aug 2024 01:25:14 +0200 Subject: [PATCH] Add tags? --- source/Main/publications.rs | 1 + source/Main/renders.rs | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/source/Main/publications.rs b/source/Main/publications.rs index da493ce..b3c5eda 100644 --- a/source/Main/publications.rs +++ b/source/Main/publications.rs @@ -169,6 +169,7 @@ pub(crate) enum CynthiaPublication { dates: CynthiaPublicationDates, thumbnail: Option, category: Option, + tags: Vec, author: Option, #[serde(alias = "content")] postcontent: PublicationContent, diff --git a/source/Main/renders.rs b/source/Main/renders.rs index f9cf2b7..d268011 100644 --- a/source/Main/renders.rs +++ b/source/Main/renders.rs @@ -135,6 +135,7 @@ struct PageLikePublicationTemplateDataMeta { title: String, desc: Option, category: Option, + tags: Vec, author: Option, dates: CynthiaPublicationDates, thumbnail: Option, @@ -143,7 +144,6 @@ struct PageLikePublicationTemplateDataMeta { mod in_renderer { use super::*; use crate::externalpluginservers::EPSRequestBody; - use crate::jsrun::JsonString; use crate::{ config::{CynthiaConfig, Scene, SceneCollectionTrait}, publications::{ContentType, CynthiaPublication, PublicationContent}, @@ -205,6 +205,7 @@ mod in_renderer { desc: description.clone(), category: None, author: None, + tags: vec![], dates: dates.clone(), thumbnail: thumbnail.clone(), }, @@ -222,6 +223,7 @@ mod in_renderer { category, author, postcontent, + tags, .. } => PageLikePublicationTemplateData { meta: PageLikePublicationTemplateDataMeta { @@ -232,6 +234,7 @@ mod in_renderer { author: author.clone(), dates: dates.clone(), thumbnail: thumbnail.clone(), + tags: tags.clone(), }, content: match fetch_page_ish_content(postcontent).await.unwrap_html() { RenderrerResponse::Ok(s) => s, @@ -337,6 +340,14 @@ mod in_renderer { return RenderrerResponse::Error; } } + head.push_str( +&format!("", + version, + serde_json::to_string(&pageish_template_data.meta.clone()).unwrap(), + localscene.kind) + + + ); if let Some(script) = localscene.script { let path: PathBuf = std::env::current_dir() .unwrap()