speculationrules – js object instead of json

This commit is contained in:
Andrea Vos 2025-02-23 16:04:15 +01:00
parent 82e9bb0087
commit 54eb35f45c

View File

@ -3,21 +3,20 @@ export default defineNuxtPlugin(() => {
script: [
{
type: 'speculationrules',
innerHTML: `
{
"prerender": [
{
"where": {
"and": [
{ "href_matches": "/*" },
{ "not": { "selector_matches": ".no-prerender" } },
{ "not": { "selector_matches": "[rel~=nofollow]" } }
]
}
}
],
"eagerness": "moderate"
}`,
innerHTML: JSON.stringify({
prerender: [
{
where: {
and: [
{ href_matches: "/*" },
{ not: { selector_matches: ".no-prerender" } },
{ not: { selector_matches: "[rel~=nofollow]" } }
]
}
}
],
eagerness: "moderate",
}),
},
],
});