Skip to content

Commit

Permalink
Add tags?
Browse files Browse the repository at this point in the history
  • Loading branch information
strawmelonjuice committed Aug 8, 2024
1 parent a2d0f87 commit cbaa4f6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions source/Main/publications.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ pub(crate) enum CynthiaPublication {
dates: CynthiaPublicationDates,
thumbnail: Option<String>,
category: Option<String>,
tags: Vec<String>,
author: Option<Author>,
#[serde(alias = "content")]
postcontent: PublicationContent,
Expand Down
13 changes: 12 additions & 1 deletion source/Main/renders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ struct PageLikePublicationTemplateDataMeta {
title: String,
desc: Option<String>,
category: Option<String>,
tags: Vec<String>,
author: Option<Author>,
dates: CynthiaPublicationDates,
thumbnail: Option<String>,
Expand All @@ -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},
Expand Down Expand Up @@ -205,6 +205,7 @@ mod in_renderer {
desc: description.clone(),
category: None,
author: None,
tags: vec![],
dates: dates.clone(),
thumbnail: thumbnail.clone(),
},
Expand All @@ -222,6 +223,7 @@ mod in_renderer {
category,
author,
postcontent,
tags,
..
} => PageLikePublicationTemplateData {
meta: PageLikePublicationTemplateDataMeta {
Expand All @@ -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,
Expand Down Expand Up @@ -337,6 +340,14 @@ mod in_renderer {
return RenderrerResponse::Error;
}
}
head.push_str(
&format!("<script>const cynthia = {{version: '{}', publicationdata: JSON.parse(`{}`), kind: '{}'}};</script>",
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()
Expand Down

0 comments on commit cbaa4f6

Please sign in to comment.