feat: robots.txt editor and tester screen

- golem15.seo.robots singleton (UI-SPEC C10): staging callout and the
  served file (P4); the plugin's own extension adds the editor, the
  tester and the AI bots tab, saved to the robots row with history
- field type robotstxt (E4, live lint, size meter; Decode refuses over
  500 KB) and widget golem15-seo-robotstester (E5) on robots_test, which
  tests the unsaved text and switches through grobotstxt
- saving rules that block a noindex address answers robots.blocks_noindex
This commit is contained in:
2026-10-27 11:51:41 +01:00
parent 3dd936202f
commit 51413fbda4
21 changed files with 1336 additions and 26 deletions

View File

@@ -1,5 +1,6 @@
// Element copy of the SEO field elements (UI-SPEC copywriting E1, E2, E3,
// plus E7 for the social image), chosen by the ui-locale attribute. Plural
// E4 and E5, plus E7 for the social image), chosen by the ui-locale
// attribute. Plural
// texts are CLDR maps; placeholders use :name.
/** A CLDR plural map: one/other in English, one/few/many/other in Polish. */
@@ -77,6 +78,29 @@ export interface Labels {
imageUploading: string
imageFailed: string
imageAlt: string
// E4
size: string
clean: string
unknown: string
unknownSuggest: string
noGroup: string
badPath: string
noColon: string
ownSitemap: string
crawlDelay: string
moreFindings: string
tooLarge: string
// E5
url: string
urlPlaceholder: string
agent: string
allowedRule: string
allowedNone: string
blocked: string
blockedBot: string
unsaved: string
stagingNote: string
urlRequired: string
}
const en: Labels = {
@@ -142,6 +166,27 @@ const en: Labels = {
imageUploading: 'Uploading…',
imageFailed: 'The image could not be uploaded.',
imageAlt: 'Social image preview',
size: ':size of 500 KB',
clean: 'No problems found.',
unknown: 'Line :line: “:word” is not a robots.txt directive.',
unknownSuggest: 'Line :line: “:word” is not a robots.txt directive. Did you mean “:suggestion”?',
noGroup: 'Line :line: this rule has no User-agent line above it, so crawlers ignore it.',
badPath: 'Line :line: a path must start with / or *.',
noColon: 'Line :line: write the directive as “Name: value”.',
ownSitemap: 'Line :line: Sitemap lines are added automatically. This one is kept as written.',
crawlDelay: 'Line :line: Google ignores Crawl-delay. Bing and Yandex use it.',
moreFindings: 'and :count more',
tooLarge: 'Over 500 KB: the file cannot be saved.',
url: 'Address',
urlPlaceholder: '/konto/ustawienia',
agent: 'Crawler',
allowedRule: 'Allowed for :agent. Rule: line :line “:rule”.',
allowedNone: 'Allowed for :agent: no rule matches this address.',
blocked: 'Blocked for :agent by line :line “:rule”.',
blockedBot: 'Blocked for :agent by its switch on the AI bots tab.',
unsaved: 'Tests the text in the editor and the AI bot switches, including unsaved changes.',
stagingNote: 'On this environment every address is blocked. The result shows the production behaviour.',
urlRequired: 'Enter an address starting with /.',
}
const pl: Labels = {
@@ -217,6 +262,27 @@ const pl: Labels = {
imageUploading: 'Wgrywanie…',
imageFailed: 'Nie udało się wgrać obrazu.',
imageAlt: 'Podgląd obrazu w mediach społecznościowych',
size: ':size z 500 KB',
clean: 'Nie znaleziono problemów.',
unknown: 'Wiersz :line: „:word” nie jest dyrektywą robots.txt.',
unknownSuggest: 'Wiersz :line: „:word” nie jest dyrektywą robots.txt. Czy chodziło o „:suggestion”?',
noGroup: 'Wiersz :line: nad tą regułą nie ma wiersza User-agent, więc roboty ją ignorują.',
badPath: 'Wiersz :line: ścieżka musi zaczynać się od / lub *.',
noColon: 'Wiersz :line: zapisz dyrektywę jako „Nazwa: wartość”.',
ownSitemap: 'Wiersz :line: wiersze Sitemap są dodawane automatycznie. Ten zostaje bez zmian.',
crawlDelay: 'Wiersz :line: Google ignoruje Crawl-delay. Bing i Yandex go stosują.',
moreFindings: 'i :count więcej',
tooLarge: 'Ponad 500 KB: nie można zapisać pliku.',
url: 'Adres',
urlPlaceholder: '/konto/ustawienia',
agent: 'Robot',
allowedRule: 'Dozwolone dla :agent. Reguła: wiersz :line „:rule”.',
allowedNone: 'Dozwolone dla :agent: żadna reguła nie pasuje do tego adresu.',
blocked: 'Zablokowane dla :agent przez wiersz :line „:rule”.',
blockedBot: 'Zablokowane dla :agent przełącznikiem w zakładce Boty AI.',
unsaved: 'Sprawdza tekst w edytorze i przełączniki botów AI, także niezapisane zmiany.',
stagingNote: 'W tym środowisku każdy adres jest zablokowany. Wynik pokazuje zachowanie na produkcji.',
urlRequired: 'Wpisz adres zaczynający się od /.',
}
const dictionaries: Record<string, Labels> = { en, pl }