mirror of
https://github.com/zyllian/webdog.git
synced 2025-05-10 02:26:42 -07:00
update templates to inherit themselves instead of manually doing it
This commit is contained in:
parent
32965f0cff
commit
b1e7529efc
6 changed files with 37 additions and 55 deletions
|
@ -246,16 +246,8 @@ impl SiteBuilder {
|
|||
Ok(String::from_utf8(output)?)
|
||||
}
|
||||
|
||||
pub fn build_page_raw(
|
||||
&self,
|
||||
page_metadata: PageMetadata,
|
||||
page_html: &str,
|
||||
) -> eyre::Result<String> {
|
||||
self.build_page_raw_with_extra_data(page_metadata, page_html, ())
|
||||
}
|
||||
|
||||
/// Helper to build a page without writing it to disk.
|
||||
pub fn build_page_raw_with_extra_data<T>(
|
||||
pub fn build_page_raw<T>(
|
||||
&self,
|
||||
mut page_metadata: PageMetadata,
|
||||
page_html: &str,
|
||||
|
@ -318,7 +310,7 @@ impl SiteBuilder {
|
|||
let mut page_html = String::new();
|
||||
pulldown_cmark::html::push_html(&mut page_html, parser);
|
||||
|
||||
let out = self.build_page_raw(page.data.unwrap_or_default(), &page_html)?;
|
||||
let out = self.build_page_raw(page.data.unwrap_or_default(), &page_html, ())?;
|
||||
|
||||
let out_path = self.build_path.join(page_name).with_extension("html");
|
||||
std::fs::create_dir_all(out_path.parent().unwrap())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue