SEO: sitemap, robots.txt and 404 pages¶
Ekit handles the technical SEO of your site for you. There is nothing to configure: each site gets a sitemap, a robots.txt, real 404 pages, and its preview addresses are never indexed.
Sitemap: /sitemap.xml¶
Each site serves an up-to-date sitemap at the root of its address, for example https://www.mysite.com/sitemap.xml. Submit this URL in Google Search Console.
It lists:
- every page of the site (each file in
views/), in every language of the project:/en/,/en/about/,/fr/about/… - detail pages: one URL per entry and per language,
/en/blog/my-article/, for the entries that have a slug in that language; - for each URL, its versions in the other languages (
hreflang, plusx-defaultfor the default language) and the date of the last change.
The sitemap is regenerated automatically after a change to the site or to the project data.
Pages left out¶
| Page | Why |
|---|---|
views/404.hbs |
The "page not found" page |
Views whose name starts with _ (views/_draft.hbs) |
Reserved for pages you do not want listed (they stay reachable by their URL) |
A page with sitemap: false in its front matter |
Excluded on request |
A page with metas.robots: noindex… |
Not meant to be indexed |
Detail pages¶
A page that loads one entry from the URL slug is detected automatically, whether the datasource is in the view or in a partial it includes:
Every entry of the blog table with a slug then gets its URL: /<lang>/<page>/<slug>/.
If your page loads the entry another way, name the table yourself:
robots.txt¶
On the site address, /robots.txt allows crawling and points to the sitemap:
404 pages¶
An address that does not exist returns a real 404 status (search engines drop it instead of indexing an empty page):
- an unknown page:
/en/does-not-exist/; - a detail page whose slug matches no entry:
/en/blog/unknown-article/. Your page is still rendered (you can show a message when the entry is missing), with the 404 status; - a detail page called without a slug:
/en/blog/whenviews/blog.hbsloads an entry withslug: "{{params.slug}}"; - an extra segment on a page that does not use the slug:
/en/contact/anything.php; - a first segment that looks like a language but is not one of the project's (
/wp,/xx/): see Languages, URLs and parameters.
Other forms of an existing page (/blog, /en/blog without the final slash…) are redirected to its official address: see Canonical addresses.
By default, Ekit shows a neutral "Page not found" page with a link back to the home page. To use your own design, create views/404.hbs: it is rendered with your layout, partials and translations, in the language of the address ({{lang}}).
<section class="py-24 text-center">
<h1>{{ektrans 'notfound.title'}}</h1>
<a href="/{{lang}}/">{{ektrans 'notfound.home'}}</a>
</section>
404 pages are never cached and never indexed.
Which address is indexed¶
| Address | Indexed |
|---|---|
Your custom domain (www.mysite.com) |
Yes |
The site's Ekit address (template-….preview.ekit.app) when the site has no custom domain |
Yes: it is the site's public address |
| The site's Ekit address when the site has a custom domain | No (noindex, Disallow: /): it would be a duplicate of your domain |
| The preview in the Studio | Never |
Indexing is controlled with the X-Robots-Tag HTTP header, so it also applies to pages that have no metas.robots.
Canonical URL
If your site is reachable from several addresses, set metas.canonical in your pages so that search engines keep the right one.