Skip to content

Commit

Permalink
add url to global data file, add site.url in sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
Ephraim-G committed Oct 30, 2024
1 parent 64b89be commit f61345a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions _data/site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ description: >- # this means to ignore newlines
# Twitter handle. Only the handle, not the URL.
twitter: 18F

# Used to construct absolute URLs throughout the site
url: "https://your-prod-url-here"

#################################################################
#
# Digital Analytics Program (DAP) configuration
Expand Down
3 changes: 1 addition & 2 deletions sitemap.xml.njk
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ eleventyExcludeFromCollections: true
<?xml version="1.0" encoding="utf-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{%- for page in collections.all %}
{% set absoluteUrl %}{{ page.url | url | absoluteUrl }}{% endset %}
<url>
<loc>{{ absoluteUrl }}</loc>
<loc>{{ site.url }}{{ page.url }}</loc>
<lastmod>{{ page.date | htmlDateString }}</lastmod>
</url>
{%- endfor %}
Expand Down

0 comments on commit f61345a

Please sign in to comment.