add dates to posts

This commit is contained in:
りき萌 2025-08-26 20:19:25 +02:00
parent da4ebd294c
commit fcaf5d8ad9
3 changed files with 17 additions and 8 deletions

View file

@ -29,6 +29,8 @@ struct Page {
tree_path: String,
doc: String,
feed: Option<Feed>,
updated: Option<DateTime<Utc>>,
tags: Vec<String>,
}
#[derive(Serialize)]
@ -129,6 +131,8 @@ impl DocDir {
.ok()?,
})
}),
updated: doc.attributes.updated,
tags: doc.attributes.tags.clone(),
},
},
)

View file

@ -86,6 +86,14 @@ main.doc {
--recursive-mono: 0;
}
}
& header {
& h1 {
padding-bottom: 0.25lh;
}
padding-bottom: 1.5lh;
}
}
& section.feed {

View file

@ -4,14 +4,11 @@
{{#if (ne page.tree_path 'index')}}
<header>
<h1 class="page-title"><a href="{{ config.site }}/{{ page.tree_path }}">{{ page.title }}</a></h1>
<ul class="feeds">
{{#each page.feeds as |feed|}}
<li>
<time datetime="{{ feed.updated }}">{{ iso_date feed.updated }}</time>
{{#if (gt (len page.feeds) 0)}}<span class="source-feed">[<a href="{{ feed.url }}">{{ feed.name }}</a>]</span>{{/if}}
</li>
{{/each}}
</ul>
{{#if page.updated}}
<time datetime="{{ page.updated }}">{{ iso_date page.updated }}</time>
{{/if}}
<div class="metadata">
</div>
</header>
{{/if}}