Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: properly localize the sitemaps #373

Merged
merged 4 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions helix-query.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
version: 1

indices:
sitemap:
sitemap-en-us:
target: /query-index.xlsx
exclude:
- 'article/category/default'
- 'drafts/**'
- 'fragments/**'
- 'en-gb/**'
- 'tools/**'
properties:
properties: &sitemap-base-props
title:
select: head > meta[property="og:title"]
value: |
Expand All @@ -25,6 +26,21 @@ indices:
select: none
value: |
parseTimestamp(headers["last-modified"], "ddd, DD MMM YYYY hh:mm:ss GMT")
sitemap-en-gb:
target: /en-gb/query-index.xlsx
include:
- '/en-gb/**'
exclude:
- 'drafts/**'
- 'tools/**'
- 'en-gb/article/category/default'
- 'en-gb/drafts/**'
- 'en-gb/fragments/**'
properties:
<<: *sitemap-base-props
primary-language-url:
select: head > meta[name="primary-language-url"]
value: attribute(el, "content")
articles:
include:
- '/article/**'
Expand Down
18 changes: 13 additions & 5 deletions helix-sitemap.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
sitemaps:
default:
origin: https://www.petplace.com
source: /query-index.json
destination: /sitemap.xml
lastmod: YYYY-MM-DD
petplace:
default: en-us
languages:
en-us:
source: /query-index.json
destination: /sitemap.xml
hreflang: en-US
lastmod: YYYY-MM-DD
en-gb:
source: /en-gb/query-index.json
destination: /sitemap-en-gb.xml
hreflang: en-GB
lastmod: YYYY-MM-DD
11 changes: 11 additions & 0 deletions sitemap-index.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://www.petplace.com/sitemap.xml</loc>
</sitemap>
<!-- Commented out until go-live
<sitemap>
<loc>https://www.example.com/sitemap-en-gb.xml</loc>
</sitemap>
-->
</sitemapindex>
Loading