Add compact post support
This commit is contained in:
parent
d12bacafa5
commit
c8cf7919dc
|
@ -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"));
|
||||
|
|
|
@ -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(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue