draft branches, some minor cleanups

This commit is contained in:
りき萌 2024-02-20 22:36:47 +01:00
parent 3a8799f581
commit 90de54c359
7 changed files with 66 additions and 12 deletions

View file

@ -64,6 +64,11 @@ pub struct Attributes {
/// Enable `mini_template` templating in this branch.
#[serde(default)]
pub template: bool,
/// Publishing stage; if `Draft`, the branch is invisible unless treehouse is compiled in
/// debug mode.
#[serde(default)]
pub stage: Stage,
}
/// Controls for block content presentation.
@ -100,3 +105,14 @@ pub struct Classes {
#[serde(default)]
pub branch_children: String,
}
/// Publish stage of a branch.
///
/// Draft branches are not included in release builds of treehouse. In debug builds, they are also
/// marked with an extra "draft" before the content.
#[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize)]
pub enum Stage {
#[default]
Public,
Draft,
}