Polaris Astro documentation
SEO and sharing
What Polaris does for search engines and social sharing, the structured data it adds for each page type, and what to set before you launch.
Before you launch
- Domain: set
siteinastro.config.mjsandurlinsrc/site.config.tsto your address. Canonical URLs, the sitemap, share images and structured data all use them. - Descriptions: give every page file a
description, up to 170 characters, saying what the page is about. Trips, stays and destinations use theirsummary, and journal posts use theirs. - Share image: set
shareImageinsite.config.tsto a photo insrc/assets/images/. Pages with their own photo, such as trips and posts, use that instead, and a page file can setimage:to choose one. - Business details: fill in
legalName,founded,priceRange,phone,emailandaddressinsite.config.ts. They go into your structured data. - Photo descriptions: write a real
imageAltfor every photo. - Demo pages: delete
src/pages/blocks.astroandsrc/pages/style-guide.astroif you don’t want the block library and style guide online. They are already left out of the sitemap and disallowed inrobots.txt.
What Polaris does for you
- A canonical URL, title and description on every page. The title is the page title followed by your
name. - Open Graph and Twitter Card tags with a 1200 x 630 image, so links look good when shared.
- A sitemap at
/sitemap-index.xml, and arobots.txtthat allows crawlers, points to the sitemap and disallows/blocks/and/style-guide/. - An RSS feed of your journal at
/journal/rss.xml. - Structured data (JSON-LD) for each page type, written automatically in
src/lib/seo.ts(see below). - Clean HTML: the first heading on each page is the one
h1, forms have labels and photos have descriptions. - A static site with almost no JavaScript, which keeps pages fast.
Structured data
| Page | Structured data |
|---|---|
| Every page except the home page | BreadcrumbList |
Home, about and contact pages |
TravelAgency, built from name, legalName, tagline, phone, email, address, founded, priceRange and social |
| Trips | TouristTrip, with an Offer for each upcoming departure (or one offer from priceFrom), the itinerary as a list, and the trip style |
| Stays | LodgingBusiness, Campground (for camp), BedAndBreakfast (for homestay and guesthouse) or Hotel (for boutique and luxury), with location, price range, check-in and check-out times and amenities |
| Destinations | TouristDestination, with location |
| Journal posts | BlogPosting, with the author and date |
faq blocks |
FAQPage |
Reviews are left out of the structured data on purpose, because search engines ignore ratings a business publishes about itself.
If a page has more than one faq block, set jsonld: false on all but one, so the page has a single FAQ list.
Hiding a page from search engines
Add noindex: true to a page file. It adds a noindex tag, removes the page from the sitemap and leaves it out of site search.
After launch
Add your site to Google Search Console and submit https://yourdomain.com/sitemap-index.xml. Do the same in Bing Webmaster Tools.
Site search is covered in Search.