-
- Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Describe the bug
When using the @sveltejs/adapter-static and appending a script tag with application/ld+json type to svelte:head, it won't show up in the build version of your site/app. It shows up correctly when you're developing, but npm run build loses it from head tag.
Code sample:
<script> const item_title = 'Hello world!'; const schema = { "@context": "http://schema.org", "@type": "Article", "@name": item_title }; </script> <svelte:head> {@html '<script type="application/ld+json">' + JSON.stringify(schema) + '</script>'} </svelte:head> To Reproduce
Append script tag with application/ld+json attribute on svelte:head and build/export site using static adapter.
Expected behavior
Added script tag / ld json schema should be visible in head tag after exporting the site as static.
Information about your SvelteKit Installation:
Diagnostics
System:
OS: Windows 10 10.0.18363
CPU: (4) x64 Intel(R) Core(TM) i5-4690K CPU @ 3.50GHz
Memory: 2.39 GB / 7.95 GB
Binaries:
Node: 15.12.0 - C:\Program Files\nodejs\node.EXE
npm: 7.6.3 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 89.0.4389.114
Edge: Spartan (44.18362.449.0)
Internet Explorer: 11.0.18362.1
npmPackages:
@sveltejs/kit: next => 1.0.0-next.74
svelte: ^3.29.0 => 3.37.0
vite: ^2.1.0 => 2.1.5
Static adapter.
Severity
Mediumish