Add compact post support
This commit is contained in:
parent
d12bacafa5
commit
c8cf7919dc
|
@ -133,7 +133,9 @@ impl<'s> Writer<'s> {
|
||||||
// {{{ Section
|
// {{{ Section
|
||||||
Container::Section { id } => {
|
Container::Section { id } => {
|
||||||
if self.metadata.title.id == *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)?;
|
let mut renderer = template!("templates/post.html", out)?;
|
||||||
|
|
||||||
assert_eq!(renderer.current(), Some("attrs"));
|
assert_eq!(renderer.current(), Some("attrs"));
|
||||||
|
|
|
@ -28,6 +28,10 @@ pub struct PageConfig {
|
||||||
|
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub draft: bool,
|
pub draft: bool,
|
||||||
|
|
||||||
|
/// Hides away the traditional header
|
||||||
|
#[serde(default)]
|
||||||
|
pub compact: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PageConfig {
|
impl PageConfig {
|
||||||
|
@ -73,6 +77,7 @@ impl PageConfig {
|
||||||
self.sitemap_exclude |= other.sitemap_exclude;
|
self.sitemap_exclude |= other.sitemap_exclude;
|
||||||
self.hidden |= other.hidden;
|
self.hidden |= other.hidden;
|
||||||
self.draft |= other.draft;
|
self.draft |= other.draft;
|
||||||
|
self.compact |= other.compact;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue