{"phrases":["seo","semantic html","alt text","meta tags","progressive enhancement","spa","open graph","structured data","html5","localstorage","sessionstorage","personalization","remember user preference"]}
Package contents
Files included with this skill beyond the listing page.
skill mdSKILL.md10,358 B
docsSUMMARY.md341 B
History
First seen on skills.sh
First recorded snapshot · 655 installs
SKILL.md
Semantic HTML and SEO
Good HTML is not just markup — it is the contract between your content, search engines, assistive technologies, and the browser. Semantic HTML, correct metadata, and progressive enhancement make UI resilient, findable, and accessible by default.
Semantic HTML5
Use the element that describes the content's meaning, not just its appearance.
Document structure
<header> <!-- site header, logo, primary nav -->
<nav> <!-- navigation links -->
<main> <!-- primary page content, one per page -->
<article> <!-- self-contained content: blog post, product card, news item -->
<section> <!-- thematic grouping with a heading -->
<aside> <!-- tangentially related content: sidebar, callout -->
<footer> <!-- site footer, secondary links, copyright -->
Headings
One <h1> per page — the primary topic. Headings form an outline: do not skip levels (h1 → h3 without h2).
<title>Product Name — Short descriptor | Brand</title>
<meta name="description" content="One or two sentences. What this page is, who it is for, what they will find.">
Title: 50–60 characters. Most important keyword first.
Description: 120–160 characters. Shown in search results — write for the human, not the algorithm.
Common types: Product, Article, BreadcrumbList, FAQPage, Organization, SiteLinksSearchBox.
Progressive Enhancement
Build in layers. The core content and function must work without JavaScript. Enhance with CSS. Enhance further with JS.
Layer 1: HTML — content is readable, links work, forms submit
Layer 2: CSS — layout, typography, visual design
Layer 3: JS — interactivity, animations, dynamic content
In practice:
Forms must submit via native <form action> without JS — JS can intercept and enhance with fetch
Navigation links must be real <a href> — JS can add transitions
Content must be in the HTML — JS can enhance with lazy-load or personalisation
Images must have src — JS can add lazy loading via loading="lazy" (now native)
SPA Considerations
Single-page applications break browser defaults that SEO and accessibility depend on. Fix them explicitly.
Server-side rendering or static generation
Client-rendered HTML is not reliably indexed by search engines. Use SSR (Next.js, Nuxt, SvelteKit) or static generation for any content that needs to be found.
Title and meta updates
Update document.title and meta tags on every route change. Use the framework's <Head> component or equivalent.
Focus management
On route change, move focus to the new page's <h1> or <main> — screen readers do not detect SPA navigation automatically.
// After route change
document.querySelector('h1')?.focus();
Scroll restoration
Restore scroll position to top on navigation, or to the saved position on back navigation. Browser default scroll restoration is disabled in SPAs.
History API
Use pushState / replaceState so back/forward navigation and bookmarking work correctly.
Device Capabilities and User Context
Design and code should adapt to what the device and user can actually do.
Client-side storage as a personalization tool
localStorage, sessionStorage, and other browser capabilities (cookies, IndexedDB, media/permission queries) are legitimate tools for tailoring the experience — last view mode, chosen locale, a dismissed banner, an in-progress draft, a returning user's context.
Guardrails:
Personalise from real understanding, not a guess. What to persist and pre-fill safely usually needs customer testing — a wrong assumption in stored state is worse than a neutral default.
Scope and consent.sessionStorage for one session, localStorage across sessions; never store anything sensitive client-side; honour consent.
Re-validate every 2–3 years. Needs drift; a personalization that fit at launch becomes friction. Revisit, ideally with fresh testing.