forked from slonk/bingus-blog
add color to index
This commit is contained in:
parent
3623b61fbe
commit
38d93a66ba
2 changed files with 8 additions and 1 deletions
|
@ -34,6 +34,7 @@ struct IndexTemplate<'a> {
|
|||
rss: bool,
|
||||
df: &'a DateFormat,
|
||||
js: bool,
|
||||
color: Option<&'a str>,
|
||||
}
|
||||
|
||||
#[derive(Template)]
|
||||
|
@ -70,6 +71,7 @@ async fn index<'a>(
|
|||
rss: config.rss.enable,
|
||||
df: &config.date_format,
|
||||
js: config.js_enable,
|
||||
color: config.default_color.as_deref(),
|
||||
}
|
||||
.into_response())
|
||||
}
|
||||
|
|
|
@ -7,11 +7,16 @@
|
|||
<meta name="description" content="{{ title }}" />
|
||||
<meta property="og:title" content="{{ title }}" />
|
||||
<meta property="og:description" content="{{ description }}" />
|
||||
{% match color %} {% when Some with (color) %}
|
||||
<meta name="theme-color" content="{{ color }}" />
|
||||
{% when None %} {% endmatch %}
|
||||
<title>{{ title }}</title>
|
||||
<link rel="stylesheet" href="/static/style.css" />
|
||||
{% if rss %}
|
||||
<link rel="alternate" type="application/rss+xml" title="{{ title }}" href="/feed.xml" />
|
||||
{% endif %} {% if js %}
|
||||
{% endif %}
|
||||
<!-- prettier-br -->
|
||||
{% if js %}
|
||||
<script src="/static/main.js" defer></script>
|
||||
{% endif %}
|
||||
</head>
|
||||
|
|
Loading…
Reference in a new issue