diff --git a/src/render.rs b/src/render.rs index 9dd3e2e..514317b 100644 --- a/src/render.rs +++ b/src/render.rs @@ -2,14 +2,16 @@ use crate::config::Config; use crate::entries::Entry; pub const DEFAULT_TEMPLATE: &str = include_str!("../templates/default.html"); +pub const DEFAULT_STYLE: &str = include_str!("../templates/default.css"); pub fn render_page(template: &str, config: &Config, entries: &[Entry], form_html: &str) -> String { let entries_html = render_entries(entries, &config.separator); - let style = if config.style.is_empty() { - String::new() + let css = if config.style.is_empty() { + DEFAULT_STYLE } else { - format!("", config.style) + &config.style }; + let style = format!(""); template .replace("{{title}}", &config.site_title) .replace("{{form}}", form_html) diff --git a/templates/default.html b/templates/default.html index 93004e5..e1f6074 100644 --- a/templates/default.html +++ b/templates/default.html @@ -2,32 +2,21 @@ Default guestbook template. Copy this file and point BOOK_TEMPLATE at your copy to customize. + Placeholders are inserted with double curly braces, e.g. curly-title-curly. + Available placeholders: - {{title}} - Site title (BOOK_SITE_TITLE). Useful in