-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(config): allow setting commands configuration in the site config…
…uration file
- Loading branch information
1 parent
dc6b330
commit 8cb8c49
Showing
3 changed files
with
75 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Default, Debug, Clone, Deserialize, Serialize)] | ||
pub struct BuildConfig { | ||
#[serde(default = "default_minify")] | ||
pub minify: bool, | ||
} | ||
|
||
fn default_minify() -> bool { true } | ||
|
||
#[derive(Default, Debug, Clone, Deserialize, Serialize)] | ||
pub struct ServeConfig { | ||
#[serde(default = "default_port")] | ||
pub port: u16, | ||
#[serde(default = "default_drafts")] | ||
pub drafts: bool, | ||
#[serde(default)] | ||
pub host: bool, | ||
#[serde(default)] | ||
pub open: bool, | ||
} | ||
|
||
fn default_port() -> u16 { 3030 } | ||
fn default_drafts() -> bool { true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters