Files
Jakub Zych 4a82240429 feat(17-03): full sitemap generation, settings, hooks and import commands
- generator in Definition::addItemToSet order: 50000 URL cap, lastmod from
  the record or the updates manifest (regular file, 5 MiB cap, fail safe),
  BeforeAddItem (skip) and AddItem (extra XML) festival events, tier or item
  priority, per-alternate expansion of list type children
- priority tiers from golem15.sitemap.priority_tiers, compiled at boot,
  defaults equal to the PHP getPriorityForUrl rules
- frontend_url rewrite of loc, xhtml:link href and the stylesheet href;
  GET /sitemap.xsl serves the PHP stylesheet byte for byte
- golem15_sitemap_settings singleton and Settings model
- sitemap:import (PHP ImportCommand) and sitemap:import-winter with the
  read-only Winter export SQL
- urlto and full goldens generated from PHP; TestSitemapImportSmoke
2026-10-12 17:07:39 +02:00

693 lines
12 KiB
JSON

{
"cases": [
{
"name": "escaping",
"root": "https://api.example.test",
"settings": {
"enable_priority_tiers": false
},
"items": [
{
"type": "url",
"url": "https://a&b<c>.pl/x",
"changefreq": "a&b<c>\"d'e\rf\tg\nh",
"priority": "0.5 & <1> \"q\" 'a'"
},
{
"type": "acme-post",
"reference": "1",
"urlPattern": "",
"changefreq": "x>y",
"priority": "<0.9>",
"nesting": "1"
}
],
"types": {
"acme-post": {
"1": {
"url": "/zażółć & co",
"mtime": "2026-01-02T03:04:05+00:00",
"alternates": [
[
"x\"y&z<\t\n\r'>",
"https://q&r<s>.pl/p"
],
[
"en",
"/en/zażółć"
]
]
}
}
}
},
{
"name": "empty-urlset",
"root": "https://api.example.test",
"items": [
{
"type": "acme-post",
"reference": "404",
"urlPattern": "",
"changefreq": "daily",
"priority": "0.7",
"nesting": "1"
},
{
"type": "unknown-type",
"reference": "1",
"urlPattern": "",
"changefreq": "daily",
"priority": "0.7",
"nesting": "1"
}
],
"types": {
"acme-post": {}
}
},
{
"name": "no-items",
"root": "https://api.example.test",
"items": []
},
{
"name": "hreflang-list",
"root": "https://api.example.test",
"settings": {
"enable_priority_tiers": false
},
"items": [
{
"type": "acme-list",
"reference": "",
"urlPattern": "",
"changefreq": "monthly",
"priority": "0.4",
"nesting": "1"
}
],
"types": {
"acme-list": {
"": {
"url": "",
"items": [
{
"url": "/pl/a",
"mtime": "2026-02-01T00:00:00+00:00",
"alternates": [
[
"pl",
"/pl/a"
],
[
"en",
"/en/a"
]
]
},
{
"url": "/pl/b",
"mtime": null,
"alternates": [
[
"pl",
"/pl/b"
],
[
"en",
"/en/b"
],
[
"de",
"/de/b"
]
]
},
{
"url": "/solo",
"alternates": []
}
]
}
}
}
},
{
"name": "nested",
"root": "https://api.example.test",
"settings": {
"enable_priority_tiers": false
},
"items": [
{
"type": "acme-cat",
"reference": "5",
"urlPattern": "",
"changefreq": "daily",
"priority": "0.7",
"nesting": "1"
}
],
"types": {
"acme-cat": {
"5": {
"url": "/kategoria/a",
"mtime": "2026-03-01T12:00:00+00:00",
"alternates": [
[
"pl",
"/kategoria/a"
],
[
"en",
"/en/category/a"
]
],
"items": [
{
"url": "/kategoria/b",
"mtime": "2026-03-02T12:00:00+00:00",
"alternates": [
[
"pl",
"/kategoria/b"
],
[
"en",
"/en/category/b"
]
],
"items": [
{
"url": "/kategoria/c",
"alternates": [
[
"x-default",
"/kategoria/c"
]
]
}
]
}
]
}
}
}
},
{
"name": "tiers-default",
"root": "https://api.example.test",
"items": [
{
"type": "url",
"url": "/",
"changefreq": "weekly",
"priority": "0.3"
},
{
"type": "url",
"url": "/en",
"changefreq": "weekly",
"priority": "0.3"
},
{
"type": "url",
"url": "/en/",
"changefreq": "weekly",
"priority": "0.3"
},
{
"type": "url",
"url": "/uslugi/x",
"changefreq": "weekly",
"priority": "0.3"
},
{
"type": "url",
"url": "/uslugi/x/y",
"changefreq": "weekly",
"priority": "0.3"
},
{
"type": "url",
"url": "/realizacje/r",
"changefreq": "weekly",
"priority": "0.3"
},
{
"type": "url",
"url": "/en/work/w",
"changefreq": "weekly",
"priority": "0.3"
},
{
"type": "url",
"url": "/blog/a/b",
"changefreq": "weekly",
"priority": "0.3"
},
{
"type": "url",
"url": "/en/blog/a/b",
"changefreq": "weekly",
"priority": "0.3"
},
{
"type": "url",
"url": "/blog/a",
"changefreq": "weekly",
"priority": "0.3"
},
{
"type": "url",
"url": "/blog",
"changefreq": "weekly",
"priority": "0.3"
},
{
"type": "url",
"url": "/en/blog/",
"changefreq": "weekly",
"priority": "0.3"
},
{
"type": "url",
"url": "/uslugi",
"changefreq": "weekly",
"priority": "0.3"
},
{
"type": "url",
"url": "/kontakt",
"changefreq": "weekly",
"priority": "0.3"
},
{
"type": "url",
"url": "/kontakt/",
"changefreq": "weekly",
"priority": "0.3"
},
{
"type": "url",
"url": "/en/ai-lab/blob-playground",
"changefreq": "weekly",
"priority": "0.3"
},
{
"type": "url",
"url": "/other",
"changefreq": "weekly",
"priority": "0.3"
},
{
"type": "url",
"url": "https://elsewhere.pl/uslugi/z",
"changefreq": "weekly",
"priority": "0.3"
},
{
"type": "url",
"url": "/o-nas?x=1",
"changefreq": "weekly",
"priority": "0.3"
},
{
"type": "url",
"url": "/blog/a/b/c",
"changefreq": "weekly",
"priority": "0.3"
}
]
},
{
"name": "tiers-settings",
"root": "https://api.example.test",
"settings": {
"enable_priority_tiers": true,
"priority_homepage": "0.95",
"priority_blog": "",
"priority_legal": "0.15"
},
"items": [
{
"type": "url",
"url": "/",
"changefreq": "weekly",
"priority": "0.3"
},
{
"type": "url",
"url": "/blog/a/b",
"changefreq": "weekly",
"priority": "0.3"
},
{
"type": "url",
"url": "/regulamin",
"changefreq": "weekly",
"priority": "0.3"
},
{
"type": "url",
"url": "/x",
"changefreq": "weekly",
"priority": "0.3"
}
]
},
{
"name": "tiers-off",
"root": "https://api.example.test",
"settings": {
"enable_priority_tiers": false
},
"items": [
{
"type": "url",
"url": "/",
"changefreq": "weekly",
"priority": "0.1"
},
{
"type": "url",
"url": "/blog/a/b",
"changefreq": "weekly",
"priority": "0.2"
}
]
},
{
"name": "rewrite",
"root": "https://api.example.test",
"settings": {
"frontend_url": "https://www.example.test/",
"enable_priority_tiers": false
},
"items": [
{
"type": "url",
"url": "/",
"changefreq": "weekly",
"priority": "0.5"
},
{
"type": "url",
"url": "/a",
"changefreq": "weekly",
"priority": "0.5"
},
{
"type": "url",
"url": "https://api.example.test/b?x=https://api.example.test/c",
"changefreq": "weekly",
"priority": "0.5"
},
{
"type": "url",
"url": "https://other.example.test/api.example.test",
"changefreq": "weekly",
"priority": "0.5"
},
{
"type": "acme-list",
"reference": "",
"urlPattern": "",
"changefreq": "daily",
"priority": "0.7",
"nesting": "1"
}
],
"types": {
"acme-list": {
"": {
"url": "",
"items": [
{
"url": "/p",
"alternates": [
[
"pl",
"/p"
],
[
"en",
"https://api.example.test/en/p"
]
]
}
]
}
}
}
},
{
"name": "rewrite-same",
"root": "https://api.example.test",
"settings": {
"frontend_url": "https://api.example.test",
"enable_priority_tiers": false
},
"items": [
{
"type": "url",
"url": "/a",
"changefreq": "weekly",
"priority": "0.5"
}
]
},
{
"name": "manifest",
"root": "https://api.example.test",
"settings": {
"enable_priority_tiers": false
},
"manifest": {
"/": "2026-05-01T10:00:00+02:00",
"about/": "2026-05-02",
"/blog/x": "not a date",
"/rel": "2026-05-03T01:02:03Z"
},
"items": [
{
"type": "url",
"url": "/",
"changefreq": "weekly",
"priority": "0.5"
},
{
"type": "url",
"url": "/about",
"changefreq": "weekly",
"priority": "0.5"
},
{
"type": "url",
"url": "/about/",
"changefreq": "weekly",
"priority": "0.5"
},
{
"type": "url",
"url": "/blog/x",
"changefreq": "weekly",
"priority": "0.5"
},
{
"type": "url",
"url": "/none",
"changefreq": "weekly",
"priority": "0.5"
},
{
"type": "acme-post",
"reference": "2",
"urlPattern": "",
"changefreq": "daily",
"priority": "0.7",
"nesting": "1"
},
{
"type": "acme-post",
"reference": "3",
"urlPattern": "",
"changefreq": "daily",
"priority": "0.7",
"nesting": "1"
}
],
"types": {
"acme-post": {
"2": {
"url": "/rel",
"mtime": null,
"alternates": [
[
"pl",
"/rel"
]
]
},
"3": {
"url": "/about",
"mtime": "2026-06-01T00:00:00+00:00",
"alternates": [
[
"pl",
"/about"
]
]
}
}
}
},
{
"name": "skip-extra",
"root": "https://api.example.test",
"settings": {
"enable_priority_tiers": false
},
"skip": [
"https://api.example.test/skip-me",
"/rel-skip"
],
"extra": {
"https://api.example.test/extra": "a&b <c>"
},
"items": [
{
"type": "url",
"url": "/skip-me",
"changefreq": "weekly",
"priority": "0.5"
},
{
"type": "url",
"url": "/extra",
"changefreq": "weekly",
"priority": "0.5"
},
{
"type": "url",
"url": "/keep",
"changefreq": "weekly",
"priority": "0.5"
},
{
"type": "acme-post",
"reference": "9",
"urlPattern": "",
"changefreq": "daily",
"priority": "0.7",
"nesting": "1"
}
],
"types": {
"acme-post": {
"9": {
"url": "/rel-skip",
"alternates": [
[
"pl",
"/rel-skip"
]
]
}
}
}
},
{
"name": "precision",
"root": "https://api.example.test",
"settings": {
"enable_priority_tiers": false
},
"items": [
{
"type": "url",
"url": "/p1",
"changefreq": "daily",
"priority": 0.5
},
{
"type": "url",
"url": "/p2",
"changefreq": "daily",
"priority": 1.0
},
{
"type": "url",
"url": "/p3",
"changefreq": 7,
"priority": 1
},
{
"type": "url",
"url": "/p4",
"changefreq": "daily",
"priority": "1.0"
},
{
"type": "url",
"url": "/p5",
"changefreq": "daily",
"priority": "0.50"
},
{
"url": "/p6",
"changefreq": "daily",
"priority": "0.6",
"cmsPage": "x",
"exists": true,
"fillable": [
"a"
]
}
]
},
{
"name": "url-null",
"root": "https://api.example.test",
"settings": {
"enable_priority_tiers": false
},
"items": [
{
"type": "url",
"url": null,
"changefreq": null,
"priority": null
},
{
"type": "url",
"url": "0",
"changefreq": "daily",
"priority": "0.5"
}
]
},
{
"name": "port-root",
"root": "http://localhost:8096",
"settings": {
"enable_priority_tiers": false
},
"items": [
{
"type": "url",
"url": "/",
"changefreq": "weekly",
"priority": "0.5"
},
{
"type": "url",
"url": "/a b",
"changefreq": "weekly",
"priority": "0.5"
}
]
}
]
}