mirror of
https://github.com/Noratrieb/website.git
synced 2026-01-14 17:05:02 +01:00
parent
9dc632b657
commit
98a0527981
4 changed files with 33 additions and 20 deletions
|
|
@ -1,6 +1,6 @@
|
|||
//! Root index.html and some other static stuff
|
||||
|
||||
use std::path::Path;
|
||||
use std::{cmp::Reverse, path::Path};
|
||||
|
||||
use color_eyre::{eyre::WrapErr, Result};
|
||||
|
||||
|
|
@ -14,7 +14,13 @@ pub fn build(
|
|||
) -> Result<()> {
|
||||
let mut context = tera::Context::new();
|
||||
|
||||
context.insert("talks", &config.talks);
|
||||
let mut talks = config
|
||||
.talks
|
||||
.iter()
|
||||
.filter(|talk| talk.hidden != Some(true))
|
||||
.collect::<Vec<_>>();
|
||||
talks.sort_by_cached_key(|talk| Reverse(talk.date.clone()));
|
||||
context.insert("talks", &talks);
|
||||
|
||||
utils::copy_fn(&statics.join("root"), dist, |content, ext, _opts| {
|
||||
if ext.is_some_and(|ext| matches!(ext, "html" | "css")) {
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ struct Talk {
|
|||
location: String,
|
||||
#[serde(skip_deserializing)]
|
||||
dir_name: String,
|
||||
hidden: Option<bool>,
|
||||
}
|
||||
|
||||
impl Talk {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue