mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-10-12 10:22:39 +00:00
- Added a favicon link to all tour pages in the Japanese documentation. - Updated navigation links to include SVG icons for Home and GitHub. - Changed language button to include an SVG icon for better visual representation. - Improved theme toggle button to use SVG icons for light and dark modes. - Refactored the documentation build commands in the justfile for clarity and consistency.
48 lines
2.0 KiB
Rust
48 lines
2.0 KiB
Rust
// Default embedded theme files. Users can override any of these by placing
|
|
// a file with the same name under their <SRC>/templates/ or <SRC>/static/.
|
|
|
|
pub const TEMPLATE_BASE: &str = include_str!("../defaults/templates/base.html");
|
|
pub const TEMPLATE_PAGE: &str = include_str!("../defaults/templates/page.html");
|
|
pub const TEMPLATE_PORTAL: &str = include_str!("../defaults/templates/portal.html");
|
|
|
|
pub const STATIC_CSS_MAIN: &str = include_str!("../defaults/static/css/main.css");
|
|
pub const STATIC_JS_MAIN: &str = include_str!("../defaults/static/js/main.js");
|
|
pub const STATIC_FAVICON_SVG: &str = include_str!("../defaults/static/favicon.svg");
|
|
|
|
// Init command templates
|
|
pub const INIT_CONFIG_TOML: &str = include_str!("../defaults/config.toml");
|
|
pub const INIT_PAGE_EN_INDEX: &str = include_str!("../defaults/pages/en/index.md");
|
|
pub const INIT_PAGE_JA_INDEX: &str = include_str!("../defaults/pages/ja/index.md");
|
|
|
|
/// Returns all default templates as (name, source) pairs for Tera registration.
|
|
pub fn default_templates() -> Vec<(&'static str, &'static str)> {
|
|
vec![
|
|
("base.html", TEMPLATE_BASE),
|
|
("page.html", TEMPLATE_PAGE),
|
|
("portal.html", TEMPLATE_PORTAL),
|
|
]
|
|
}
|
|
|
|
/// Returns all default static files as (relative_path, content) pairs.
|
|
pub fn default_static_files() -> Vec<(&'static str, &'static str)> {
|
|
vec![
|
|
("css/main.css", STATIC_CSS_MAIN),
|
|
("js/main.js", STATIC_JS_MAIN),
|
|
("favicon.svg", STATIC_FAVICON_SVG),
|
|
]
|
|
}
|
|
|
|
/// Returns all init scaffold files as (relative_path, content) pairs.
|
|
pub fn init_files() -> Vec<(&'static str, &'static str)> {
|
|
vec![
|
|
("config.toml", INIT_CONFIG_TOML),
|
|
("templates/base.html", TEMPLATE_BASE),
|
|
("templates/page.html", TEMPLATE_PAGE),
|
|
("templates/portal.html", TEMPLATE_PORTAL),
|
|
("static/css/main.css", STATIC_CSS_MAIN),
|
|
("static/js/main.js", STATIC_JS_MAIN),
|
|
("pages/en/index.md", INIT_PAGE_EN_INDEX),
|
|
("pages/ja/index.md", INIT_PAGE_JA_INDEX),
|
|
]
|
|
}
|