Metadata and Sharing
Control page identity, icons, canonical URLs, and social previews from the document head.
Metadata tells browsers, search engines, and social apps how to identify a page. It belongs in head and should describe the specific URL rather than the whole site generically.
Essential page metadata
index.html
<title>HTML metadata · Arcbyte</title>
<meta name="description" content="Learn the metadata every production page needs." />
<meta name="theme-color" content="#4c1c62" />
<link rel="canonical" href="https://example.com/html/metadata" />
<link rel="icon" href="/icon.png" type="image/png" />
Keep titles descriptive and concise. A canonical link identifies the preferred URL when query strings or alternate routes expose equivalent content.
Social previews and language versions
index.html
<meta property="og:title" content="HTML metadata · Arcbyte" />
<meta property="og:description" content="Build accurate page and sharing metadata." />
<meta property="og:image" content="https://example.com/preview.png" />
<meta name="twitter:card" content="summary_large_image" />
<link rel="alternate" hreflang="zh-CN" href="https://example.com/zh-CN/html/metadata" />
Keep this
Give every public page a unique identity, a canonical URL, accurate language alternates, and a preview image designed for sharing.
学习位置已保存在此设备上。