Skip to content

Commit

Permalink
Merge pull request #80 from cloud-gov/absolute-url-fix
Browse files Browse the repository at this point in the history
add url to global data file, add site.url in sitemap
  • Loading branch information
Ephraim-G authored Nov 4, 2024
2 parents 64b89be + 0a37d8c commit 1caf71b
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://agency-production-url.gov"

#################################################################
#
# 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 1caf71b

Please sign in to comment.