From 9e64b06c1289a6489653bce110e0d8cbfb47b7f2 Mon Sep 17 00:00:00 2001 From: Bauke Date: Mon, 30 Jan 2023 12:44:16 +0100 Subject: [PATCH] Add a seperate DRG section to frontmatter data. --- source/video/2023/2023-01-29-_9xtYCGWtn4.md | 3 +++ source/video/mod.rs | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/source/video/2023/2023-01-29-_9xtYCGWtn4.md b/source/video/2023/2023-01-29-_9xtYCGWtn4.md index 7c87227..9a9a6bb 100644 --- a/source/video/2023/2023-01-29-_9xtYCGWtn4.md +++ b/source/video/2023/2023-01-29-_9xtYCGWtn4.md @@ -2,6 +2,9 @@ id = "_9xtYCGWtn4" page_title = "No HUD Hazard 5 Mining Expedition" tags = ["Deep Rock Galactic", "No HUD"] + +[drg] +mods = ["brighter-objects"] --- ## Description diff --git a/source/video/mod.rs b/source/video/mod.rs index eace324..357ee15 100644 --- a/source/video/mod.rs +++ b/source/video/mod.rs @@ -11,6 +11,9 @@ mod filters; #[derive(Debug, Template)] #[template(path = "video.html")] pub struct VideoTemplate { + /// Deep Rock Galactic data. + pub drg: Option, + /// The title of the page. pub page_title: String, @@ -26,6 +29,9 @@ pub struct VideoTemplate { #[derive(Debug, Deserialize)] pub struct VideoData { + /// Deep Rock Galactic data. + pub drg: Option, + /// The YouTube video ID. pub id: String, @@ -55,6 +61,12 @@ pub struct SpeedrunData { pub mods: Option>, } +#[derive(Debug, Deserialize)] +pub struct DeepRockGalacticData { + /// Deep Rock Galactic mods used in the run. + pub mods: Option>, +} + pub fn write_all(public_dir: &Path) -> Result<()> { let video_datas = { let mut data = vec![]; @@ -90,6 +102,7 @@ pub fn write_all(public_dir: &Path) -> Result<()> { fs::create_dir_all(&video_dir)?; let template = VideoTemplate { + drg: video_data.drg, page_title: video_data.page_title, rendered_markdown: comrak::markdown_to_html( &markdown,