Generate the metadata for a page
seo-in-astro can generate the metadata for a page in Astro, including the title, description, canonical URL, and Open Graph and Twitter metadata.
Using the Layout component
Section titled “Using the Layout component”-
Import the
Layoutcomponent into every page where you want to generate metadata.pages/index.astro ---import Layout from "@dlcastillop/seo-in-astro/Layout";---<Layouttitle="Example - Your trusted source for quality examples"description="Discover comprehensive examples and tutorials for web development, design patterns, and best practices."ogImg="/og-home.png"><h1>Example - Your trusted source for quality examples</h1></Layout> -
Check the generated metadata by inspecting the head element of your page.
Related
Section titled “Related”View related API references.
Layout API Reference for the Layout component.