Audit: catch hand-rolled link resolution (hardcoded homepage slug, URL built from a slug); comment filter fix

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-16 12:56:13 +02:00
co-authored by Claude Opus 5.5
parent f88c342be5
commit eb52253dc4
4 changed files with 32 additions and 1 deletions
+5
View File
@@ -102,6 +102,11 @@ export async function CMSLink({ link, locale, className, children }: { link: Cms
}
```
**Nie pisz własnej wersji** (`resolveHref`, `getHref`, `` `/${slug}` ``, `slug === 'home'`): gubi prefiks
języka, stronę główną z Site Settings, filtr `javascript:` i martwe linki. `ipal-audit` zgłasza to jako
ERROR. Pole w innym kształcie (np. `page` + `url`) mapujesz na kształt pluginu zamiast liczyć href:
`resolveLink(url?.trim() ? { type: 'external', url } : { type: 'internal', page }, locale)`.
## Menu — `resolveNav`
```ts