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