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,
|
rss: bool,
|
||||||
df: &'a DateFormat,
|
df: &'a DateFormat,
|
||||||
js: bool,
|
js: bool,
|
||||||
|
color: Option<&'a str>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Template)]
|
#[derive(Template)]
|
||||||
|
@ -70,6 +71,7 @@ async fn index<'a>(
|
||||||
rss: config.rss.enable,
|
rss: config.rss.enable,
|
||||||
df: &config.date_format,
|
df: &config.date_format,
|
||||||
js: config.js_enable,
|
js: config.js_enable,
|
||||||
|
color: config.default_color.as_deref(),
|
||||||
}
|
}
|
||||||
.into_response())
|
.into_response())
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,11 +7,16 @@
|
||||||
<meta name="description" content="{{ title }}" />
|
<meta name="description" content="{{ title }}" />
|
||||||
<meta property="og:title" content="{{ title }}" />
|
<meta property="og:title" content="{{ title }}" />
|
||||||
<meta property="og:description" content="{{ description }}" />
|
<meta property="og:description" content="{{ description }}" />
|
||||||
|
{% match color %} {% when Some with (color) %}
|
||||||
|
<meta name="theme-color" content="{{ color }}" />
|
||||||
|
{% when None %} {% endmatch %}
|
||||||
<title>{{ title }}</title>
|
<title>{{ title }}</title>
|
||||||
<link rel="stylesheet" href="/static/style.css" />
|
<link rel="stylesheet" href="/static/style.css" />
|
||||||
{% if rss %}
|
{% if rss %}
|
||||||
<link rel="alternate" type="application/rss+xml" title="{{ title }}" href="/feed.xml" />
|
<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>
|
<script src="/static/main.js" defer></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</head>
|
</head>
|
||||||
|
|
Loading…
Reference in a new issue