added css overdide option
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user