added css overdide option
This commit is contained in:
@@ -3,6 +3,22 @@ category = "Characters"
|
|||||||
image = "bernardo.png"
|
image = "bernardo.png"
|
||||||
content_file = "bernardo.md"
|
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]
|
[infobox]
|
||||||
"Espèce" = "Papoute Commun"
|
"Espèce" = "Papoute Commun"
|
||||||
Genre = "H"
|
Genre = "H"
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ pub struct WikiConfig {
|
|||||||
pub image: Option<String>,
|
pub image: Option<String>,
|
||||||
pub infobox: Option<IndexMap<String, String>>,
|
pub infobox: Option<IndexMap<String, String>>,
|
||||||
pub content_file: Option<String>,
|
pub content_file: Option<String>,
|
||||||
|
pub css_override: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct AppState {
|
struct AppState {
|
||||||
|
|||||||
@@ -220,6 +220,7 @@ pub async fn render_wiki_page(
|
|||||||
context.insert("next_page", &next);
|
context.insert("next_page", &next);
|
||||||
context.insert("no_navigation", &no_navigation);
|
context.insert("no_navigation", &no_navigation);
|
||||||
context.insert("is_static", &is_static);
|
context.insert("is_static", &is_static);
|
||||||
|
context.insert("css_override", &config.css_override);
|
||||||
|
|
||||||
TEMPLATES
|
TEMPLATES
|
||||||
.render("page.html", &context)
|
.render("page.html", &context)
|
||||||
|
|||||||
@@ -10,6 +10,10 @@
|
|||||||
{% endblock head %}
|
{% endblock head %}
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
{% if css_override %}
|
||||||
|
<style>{{ css_override | safe }}</style>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<body {% if no_navigation %}style="padding-top: 40px;"{% endif %}>
|
<body {% if no_navigation %}style="padding-top: 40px;"{% endif %}>
|
||||||
{% if not no_navigation %}
|
{% if not no_navigation %}
|
||||||
<nav>
|
<nav>
|
||||||
|
|||||||
Reference in New Issue
Block a user