fix: issue #11 wrong page titles compared to old app

This commit is contained in:
2026-07-05 12:58:44 +02:00
parent cf1d4bd46f
commit 28398b17f4
8 changed files with 208 additions and 10 deletions

View File

@@ -10,6 +10,7 @@ defmodule BDS.Preview.Router do
alias BDS.Posts.Post
alias BDS.Posts.Translation
alias BDS.Rendering
alias BDS.Rendering.Metadata, as: RenderMetadata
alias BDS.Rendering.TemplateSelection
alias BDS.Repo
@@ -159,7 +160,8 @@ defmodule BDS.Preview.Router do
render_list(project_id, posts, page_number, metadata, language, main_language, %{
kind: "category",
name: name
name: RenderMetadata.category_display_name(metadata.category_settings, name),
slug: name
})
end
@@ -294,7 +296,7 @@ defmodule BDS.Preview.Router do
assigns = %{
language: language,
language_prefix: language_prefix,
page_title: archive_page_title(archive_ctx),
page_title: RenderMetadata.blog_page_title(metadata.description, metadata.name),
posts: page_posts,
archive_context: archive_ctx,
pagination: pagination
@@ -334,6 +336,10 @@ defmodule BDS.Preview.Router do
end
defp archive_context_to_segments(%{kind: "core"}), do: []
defp archive_context_to_segments(%{kind: "category", slug: slug}) when is_binary(slug),
do: ["category", slug]
defp archive_context_to_segments(%{kind: "category", name: name}), do: ["category", name]
defp archive_context_to_segments(%{kind: "tag", name: name}), do: ["tag", name]