1
Fork 0

Add compact post support

This commit is contained in:
prescientmoon 2025-03-24 00:42:03 +01:00
parent d12bacafa5
commit c8cf7919dc
Signed by: prescientmoon
SSH key fingerprint: SHA256:UUF9JT2s8Xfyv76b8ZuVL7XrmimH4o49p4b+iexbVH4
2 changed files with 8 additions and 1 deletions

View file

@ -133,7 +133,9 @@ impl<'s> Writer<'s> {
// {{{ Section
Container::Section { id } => {
if self.metadata.title.id == *id {
if matches!(self.metadata.route, PageRoute::Post(_)) {
if matches!(self.metadata.route, PageRoute::Post(_))
&& !self.metadata.config.compact
{
let mut renderer = template!("templates/post.html", out)?;
assert_eq!(renderer.current(), Some("attrs"));

View file

@ -28,6 +28,10 @@ pub struct PageConfig {
#[serde(default)]
pub draft: bool,
/// Hides away the traditional header
#[serde(default)]
pub compact: bool,
}
impl PageConfig {
@ -73,6 +77,7 @@ impl PageConfig {
self.sitemap_exclude |= other.sitemap_exclude;
self.hidden |= other.hidden;
self.draft |= other.draft;
self.compact |= other.compact;
Ok(())
}