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: [ script: [
{ {
type: 'speculationrules', type: 'speculationrules',
innerHTML: ` innerHTML: JSON.stringify({
prerender: [
{ {
"prerender": [ where: {
{ and: [
"where": { { href_matches: "/*" },
"and": [ { not: { selector_matches: ".no-prerender" } },
{ "href_matches": "/*" }, { not: { selector_matches: "[rel~=nofollow]" } }
{ "not": { "selector_matches": ".no-prerender" } },
{ "not": { "selector_matches": "[rel~=nofollow]" } }
] ]
} }
} }
], ],
"eagerness": "moderate" eagerness: "moderate",
}`, }),
}, },
], ],
}); });