added css overdide option

This commit is contained in:
2026-03-20 13:02:46 +01:00
parent 6d413f81b6
commit ee8e2e3acf
4 changed files with 22 additions and 0 deletions

View File

@@ -3,6 +3,22 @@ category = "Characters"
image = "bernardo.png"
content_file = "bernardo.md"
css_override = """
#content {
background: white;
color: black;
border-radius: var(--radius-md);
}
.wiki-header h1 {
color: var(--accent);
}
.wiki-sidebar {
background: white;
}
"""
[infobox]
"Espèce" = "Papoute Commun"
Genre = "H"

View File

@@ -76,6 +76,7 @@ pub struct WikiConfig {
pub image: Option<String>,
pub infobox: Option<IndexMap<String, String>>,
pub content_file: Option<String>,
pub css_override: Option<String>,
}
struct AppState {

View File

@@ -220,6 +220,7 @@ pub async fn render_wiki_page(
context.insert("next_page", &next);
context.insert("no_navigation", &no_navigation);
context.insert("is_static", &is_static);
context.insert("css_override", &config.css_override);
TEMPLATES
.render("page.html", &context)

View File

@@ -10,6 +10,10 @@
{% endblock head %}
</head>
{% if css_override %}
<style>{{ css_override | safe }}</style>
{% endif %}
<body {% if no_navigation %}style="padding-top: 40px;"{% endif %}>
{% if not no_navigation %}
<nav>