pickstack

Angular + SEO

Meta/OG tags, canonical URL, JSON-LD, robots.txt and sitemap.xml. This page shows exactly what pickstack adds to a Angular 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 angular --modules seo --yes
Customize in the configurator

New files

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

public/robots.txt (changed)
 User-agent: *+Allow: /+ +Sitemap: https://example.com/sitemap.xml−Disallow:  
src/app/app.routes.ts (changed)
⋯ 1 unchanged lines import { Home } from "./pages/home/home";   export const routes: Routes = [+  { path: "", component: Home, title: "my-app" },−  { path: "", component: Home },   {     path: "about",+    title: "About | my-app",     loadComponent: () => import("./pages/about/about").then((m) => m.About),   }, ];⋯ 1 unchanged lines
src/app/pages/about/about.html (changed)
 <section class="page">   <h1 class="title">About</h1>+  <p class="text">Built with Angular 22, TypeScript, SEO.</p>−  <p class="text">Built with Angular 22, TypeScript.</p> </section>  
src/index.html (changed)
⋯ 4 unchanged lines     <title>my-app</title>     <base href="/" />     <meta name="viewport" content="width=device-width, initial-scale=1" />+    <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>     <app-root></app-root>⋯ 3 unchanged lines

Project files

Related templates