Skip to main content

Theme

Trait Theme 

Source
pub trait Theme: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn render_page(
        &self,
        context: &PageContext,
    ) -> Result<String, Box<dyn Error>>;
    fn config(&self) -> &Config;

    // Provided method
    fn static_resources(&self) -> Vec<(String, String)> { ... }
}
Expand description

主题 Trait,定义了主题必须实现的功能

Required Methods§

Source

fn name(&self) -> &str

获取主题名称

Source

fn render_page(&self, context: &PageContext) -> Result<String, Box<dyn Error>>

渲染页面

Source

fn config(&self) -> &Config

获取主题配置

Provided Methods§

Source

fn static_resources(&self) -> Vec<(String, String)>

获取主题的静态资源

Implementors§