The fixed items of posts are in the blog language instead of post language

This commit is contained in:
Mikko Ahlroth 2024-06-01 09:48:18 +03:00
parent 61e5023d2e
commit 23c966bce6

View file

@ -43,30 +43,39 @@ fn view(post: CompiledPost, is_full: Bool, _db: Database, config: Configuration)
article([class("post"), ..language], [
header([], [
wrap_heading(h2([], [text(post.orig.title)]), post_url, is_full),
p([class("post__time")], post_time(post.orig, config.l10n.context)),
nav([attribute("aria-label", g_(config.l10n.context, "Tags"))], [
ul(
[],
list.map(post.orig.tags, fn(tag) {
li([], [
a(
[
href(config.paths.html(
config.paths.root <> config.paths.tag(tag),
)),
],
[text(tag)],
),
])
}),
),
]),
p(
[class("post__time"), attribute("lang", config.l10n.language)],
post_time(post.orig, config.l10n.context),
),
nav(
[
attribute("lang", config.l10n.language),
attribute("aria-label", g_(config.l10n.context, "Tags")),
],
[
ul(
[],
list.map(post.orig.tags, fn(tag) {
li([], [
a(
[
href(config.paths.html(
config.paths.root <> config.paths.tag(tag),
)),
],
[text(tag)],
),
])
}),
),
],
),
]),
div([attribute("dangerous-unescaped-html", content)], []),
case is_full, post.content.short {
True, _ | False, option.None -> element.none()
False, option.Some(_) ->
footer([], [
footer([attribute("lang", config.l10n.language)], [
a([href(post_url)], [text(g_(config.l10n.context, "Read more…"))]),
])
},