pub struct Config {
pub title: Option<String>,
pub description: Option<String>,
pub base: Option<String>,
pub locales: HashMap<String, LocaleConfig>,
pub theme: ThemeConfig,
pub plugins: Vec<PluginConfig>,
pub markdown: MarkdownConfig,
pub build: BuildConfig,
}Expand description
Nargo Document 配置 - 兼容 VuTeX 配置格式
Fields§
§title: Option<String>站点标题
description: Option<String>站点描述
base: Option<String>基础路径
locales: HashMap<String, LocaleConfig>语言配置
theme: ThemeConfig主题配置
plugins: Vec<PluginConfig>插件配置
markdown: MarkdownConfigMarkdown 配置
build: BuildConfig构建配置
Implementations§
Source§impl Config
impl Config
Sourcepub fn load_from_file<P: AsRef<Path>>(path: P) -> Result<Self, ConfigError>
pub fn load_from_file<P: AsRef<Path>>(path: P) -> Result<Self, ConfigError>
Sourcepub fn load_from_json_str(json_str: &str) -> Result<Self, ConfigError>
pub fn load_from_json_str(json_str: &str) -> Result<Self, ConfigError>
Sourcepub fn load_from_toml_str(toml_str: &str) -> Result<Self, ConfigError>
pub fn load_from_toml_str(toml_str: &str) -> Result<Self, ConfigError>
Sourcepub fn load_from_dir<P: AsRef<Path>>(dir: P) -> Result<Self, ConfigError>
pub fn load_from_dir<P: AsRef<Path>>(dir: P) -> Result<Self, ConfigError>
Sourcepub fn with_title(self, title: String) -> Self
pub fn with_title(self, title: String) -> Self
设置站点标题
Sourcepub fn with_description(self, description: String) -> Self
pub fn with_description(self, description: String) -> Self
设置站点描述
Sourcepub fn add_locale(self, lang: String, config: LocaleConfig) -> Self
pub fn add_locale(self, lang: String, config: LocaleConfig) -> Self
添加语言配置
Trait Implementations§
Source§impl ConfigValidation for Config
impl ConfigValidation for Config
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more