As a final step in optimizing your site, it’s important to consider Search Engine Optimization (SEO)
and how to use metadata to improve your site’s visibility in search engine results. Many users will
not be able to find your site if it doesn’t appear in search engine results or may find the site
but not understand what it’s about if you don’t use metadata effectively.
There exist various metadata protocols and standards that cater to different use cases and/or platforms
that may crawl and index you site(s). Two of the most common and widely supported metadata standards are
OpenGraph and Twitter Cards.
OpenGraph was developed by Facebook in 2010 as a way to allow web pages to become rich objects in a social graph.
It is widely supported by many platforms, including Facebook, LinkedIn, and Twitter. OpenGraph metadata appears
enclosed in the <head> of your HTML document.
---
const title = "WebCo"
const description = "WebCo is a modern web development company specializing in creating stunning websites and applications that captivate audiences and drive business growth."
The above example leverages both OpenGraph and Twitter card protocols to provide the same metadata
in both accepted formats. Various platforms may adopt these. For example, see what happens
when you share a site in Discord.
A [convenient guide] for these and other metadata standards is available on MetaTags.io.
Metadata also extends to branding on a micro-scale. For example, you can use the favicon to provide a
small icon that represents your site in browser tabs and bookmarks.
<link rel="icon" href="/favicon.ico" />
By default, Astro ships an Astro-branded favicon as favicon.ico in the public directory. This filename
is the de fact standard for the favicon, so you can simply replace this file with your own custom icon
to update the favicon for your site.
For example, the course website icon is a custom icon that represents the course and is
used as the favicon for the site.
For search engines to effectively crawl and index your site, it’s important to provide a sitemap
that outlines the structure of your site and the relationships between different pages and resources.
A sitemap is an XML file that provides information about the pages, videos, and other files on your site,
and the relationships between them. Often, this appears in more elaborate views of your site
via search results. For example, see the following sitemap from our course site:
const description = "WebCo is a modern web development company specializing in creating stunning websites and applications that captivate audiences and drive business growth."