pickstack

Svelte + SEO

Meta/OG tags, canonical URL, JSON-LD, robots.txt and sitemap.xml. This page shows exactly what pickstack adds to a Svelte project for SEO: the packages, the new files and the changes to existing ones. Every combination is installed, built, linted and tested in CI.

$ npm create pickstack@latest my-app -- --framework svelte --modules seo --yes
Customize in the configurator

New files

public/robots.txt
User-agent: *
Allow: /

Sitemap: https://example.com/sitemap.xml
public/sitemap.xml
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/</loc>
  </url>
</urlset>

Changes to existing files

index.html (changed)
⋯ 3 unchanged lines     <meta charset="UTF-8" />     <meta name="viewport" content="width=device-width, initial-scale=1.0" />     <title>my-app</title>+    <meta name="description" content="my-app: a web app." />+    <link rel="canonical" href="https://example.com/" />+    <meta property="og:type" content="website" />+    <meta property="og:site_name" content="my-app" />+    <meta property="og:title" content="my-app" />+    <meta property="og:description" content="my-app: a web app." />+    <meta property="og:url" content="https://example.com/" />+    <meta name="twitter:card" content="summary" />+    <script type="application/ld+json">+      {+        "@context": "https://schema.org",+        "@type": "WebSite",+        "name": "my-app",+        "url": "https://example.com/"+      }+    </script>   </head>   <body>     <div id="app"></div>⋯ 4 unchanged lines

Project files

Related templates