feat: H1 to H2 setting with the admin save conversion (tracer)

- content_h1_to_h2 and generic_anchors on the settings row (migration
  202610280001), Headings and links tab, config key
  golem15.journal.content_h1_to_h2 used when no settings row exists
- classes.ConvertH1 on the x/net/html tokenizer; the Blog Editor types
  convert while the setting is on and answer editor.h1_converted
- GET /posts/{slug} reports content_h1_to_h2 (additive key)
This commit is contained in:
Jakub Zych
2026-11-04 09:44:58 +01:00
parent f7bfb3313b
commit 305f94afd9
15 changed files with 553 additions and 7 deletions

View File

@@ -55,6 +55,11 @@ journal:
rss_image_url_comment: URL to an image/logo displayed in feed readers.
rss_posts_per_feed_label: Posts per feed
rss_posts_per_feed_comment: Default number of posts in the RSS feed. Can be overridden per component.
tab_headings: Headings and links
h1_to_h2_label: Convert H1 to H2 in post and category content
h1_to_h2_comment: 'Turn it off only when the page template does not show the post title or the category name as the H1. On: the editor offers H2–H4, and every H1 saved through the admin, the API, MCP or an import becomes an H2. Off: content keeps its H1 headings, and the site shows them unchanged.'
generic_anchors_label: Generic link texts
generic_anchors_comment: One per line. The editor warns when the whole text of a link is one of these.
posts:
list_title: Manage the journal posts
filter_category: Category
@@ -157,3 +162,6 @@ editor:
one: ":count HTML comment was removed"
other: ":count HTML comments were removed"
markup_changed: The HTML filter changed some markup.
h1_converted:
one: ":count H1 heading was converted to H2, because the page shows the post title as the H1."
other: ":count H1 headings were converted to H2, because the page shows the post title as the H1."

View File

@@ -32,6 +32,11 @@ journal:
search_excerpt_weight_comment: Waga trafności dla dopasowań w zajawce posta (domyślnie 3).
search_content_weight_label: Waga treści
search_content_weight_comment: Waga trafności dla dopasowań w treści posta (domyślnie 1).
tab_headings: Nagłówki i linki
h1_to_h2_label: Zamieniaj H1 na H2 w treści wpisów i kategorii
h1_to_h2_comment: 'Wyłącz tylko wtedy, gdy szablon strony nie wyświetla tytułu wpisu ani nazwy kategorii jako H1. Włączone: edytor oferuje H2–H4, a każdy H1 zapisany przez panel, API, MCP lub import staje się H2. Wyłączone: treść zachowuje nagłówki H1, a witryna wyświetla je bez zmian.'
generic_anchors_label: Ogólnikowe teksty linków
generic_anchors_comment: Jeden w wierszu. Edytor ostrzega, gdy cały tekst linku jest jednym z nich.
posts:
list_title: Zarządzaj postami
filter_category: Kategoria
@@ -115,3 +120,8 @@ editor:
many: "Usunięto :count komentarzy HTML"
other: "Usunięto :count komentarza HTML"
markup_changed: Filtr HTML zmienił część znaczników.
h1_converted:
one: "Zamieniono :count nagłówek H1 na H2, bo strona wyświetla tytuł wpisu jako H1."
few: "Zamieniono :count nagłówki H1 na H2, bo strona wyświetla tytuł wpisu jako H1."
many: "Zamieniono :count nagłówków H1 na H2, bo strona wyświetla tytuł wpisu jako H1."
other: "Zamieniono :count nagłówka H1 na H2, bo strona wyświetla tytuł wpisu jako H1."