Docs menu

Every HTML page needs the required meta tags

WARN Frame web/html-required-meta
On this page

Every shipping HTML page (plain *.html, SvelteKit +page.svelte / +layout.svelte, Astro *.astro) must declare:

  1. <meta charset> - character encoding. Browsers tolerate the omission but parsers can fall back to legacy decoders.
  2. <meta name="viewport"> - mobile rendering. Without this, mobile devices render at desktop width and zoom out.
  3. <title> - required by every browser tab, every share, every search result.

In SvelteKit projects, the title is usually injected via <svelte:head> in a layout. This frame treats the presence of <svelte:head> as satisfying the title requirement on the assumption the layout (or this component) is filling it in.

Site generator templates#

Template fragments of a static site generator are skipped: files under Hugo’s layouts/ (next to hugo.toml, config.toml or another Hugo config) and Jekyll’s _layouts/ and _includes/ (next to _config.yml). They are pieces of a page, not pages; the built output (for example public/) is checked instead. A layouts/ folder without the generator’s config beside it is checked as usual.

Fix#

For a SvelteKit project, put the static meta in src/routes/+layout.svelte:

<svelte:head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <title>Your Site</title>
</svelte:head>

For Astro: in the root layout’s <head>:

<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <title>{title}</title>
</head>

For plain HTML: just add the tags in <head>.

Suppressing intentional cases#

For email templates, partial HTML fragments, or non-page artifacts:

<!-- appframes:disable web/html-required-meta -->
<!-- This file is included as a partial; meta lives in the parent template. -->

WARN lets the push through and records the finding. Turn frames on per repo on the dashboard's Policy page - see choosing what the gate checks.

Source on GitHub Live demo How it works Questions: contact@nimblegate.com