Audit URL
You might be wondering how the Kirby SEO Audit plugin knows which URL to process? The answer is simple: it retrieves the previewUrl
of the current Kirby page model. This means that the URL used to generate the SEO report is the same as the one opened by clicking the preview button in the Panel. Which means that draft pages can be SEO-checked as well.
The plugin fetches the HTML content of the preview URL, performs the SEO evaluation on it and generates the SEO report.
Site vs. Page Level
Technically, the plugin works with any Kirby model. It uses the previewUrl
method of the current mode (site, page or file). In the blueprint template you can customize this preview URL (see next section).
So you can use the plugin on pages and sites, and even change the URL per template if you need to.
Custom Target URL
In certain cases, you might want to customize the target URL used to generate the SEO report for. This can be done by adding a preview
field to the page's options in the blueprint:
options:
preview: https://getkirby.com
sections:
seoAudit:
type: seo-audit