Skip to content

SEO: add JSON-LD structured data (SoftwareSourceCode, WebSite+SearchAction, BreadcrumbList, TechArticle) #255

Description

@limonte

Problem

The site has no structured data at all — no JSON-LD, no microdata. For a library documentation site there are several schema types that Google actively uses.

Suggested additions

1. SoftwareSourceCode / SoftwareApplication on the homepage — describes the library itself (name, license MIT, repo URL, programming language, version). Feeds knowledge-panel-style understanding of "what is SweetAlert2".

{
  "@context": "https://schema.org",
  "@type": "SoftwareSourceCode",
  "name": "SweetAlert2",
  "description": "A beautiful, responsive, customizable, accessible (WAI-ARIA) replacement for JavaScript's popup boxes",
  "codeRepository": "https://github.com/sweetalert2/sweetalert2",
  "programmingLanguage": "JavaScript",
  "license": "https://opensource.org/licenses/MIT",
  "url": "https://sweetalert2.github.io/"
}

2. WebSite + SearchAction — the site already has Algolia DocSearch; declaring it enables a sitelinks search box.

3. BreadcrumbList on the 21 recipe pagesHome › Recipe Gallery › Colored Toasts. Google renders breadcrumb trails in place of the raw URL in search results. There is currently no breadcrumb markup or visible breadcrumb UI (recipe pages only have a "Back to Recipe Gallery" link).

4. TechArticle on each recipe pageheadline, description, about, proficiencyLevel. Recipes are exactly what this type is for.

5. Organization — for the SweetAlert2 project, with logo and sameAs pointing at the GitHub org / npm.

6. FAQPage — only if a real FAQ section gets added; not applicable today.

Where to put it

partials/head.html can take a jsonld param the same way it takes title, with tools/generate-recipe-html.mjs emitting per-recipe BreadcrumbList + TechArticle blocks from its existing recipes array.

Validate with the Rich Results Test and validator.schema.org.

Impact

Medium — no direct ranking boost, but breadcrumbs and richer result presentation measurably improve CTR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions