mirror of
https://github.com/getzola/zola
synced 2025-01-08 09:58:49 +00:00
17 lines
423 B
Rust
17 lines
423 B
Rust
|
pub struct ShortCode {
|
||
|
pub name: &'static str,
|
||
|
pub output: &'static str,
|
||
|
pub is_md: bool,
|
||
|
}
|
||
|
|
||
|
impl ShortCode {
|
||
|
pub const fn new(name: &'static str, output: &'static str, is_md: bool) -> ShortCode {
|
||
|
ShortCode { name, output, is_md }
|
||
|
}
|
||
|
|
||
|
/// Return filename for shortcode
|
||
|
pub fn filename(&self) -> String {
|
||
|
format!("{}.{}", self.name, if self.is_md { "md" } else { "html" })
|
||
|
}
|
||
|
}
|