site
The URL the site is published at. It is Astro’s own option: it can be set here
or in astro.config, and counts either way.
| Type | Default |
|---|---|
string |
none |
site: 'https://docs.example.dev',
Set it as soon as the URL is known. Without it, the build warns and leaves out what needs an absolute URL:
- the canonical link and the
hreflanglinks of each page; - the sitemap;
- the social image of a local file;
- absolute links in
llms.txt,llms-full.txtand the Markdown of each page, which an agent reading them elsewhere cannot follow otherwise.
In JAAB, the feed needs it too: without site,
the build warns and writes no rss.xml.
Use cases
A site below a path
Set the host in site and the path in base:
site: 'https://me.github.io',
base: '/my-repo',