Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

Commit

Permalink
VOTE-1381: add html sitemap for English (#851)
Browse files Browse the repository at this point in the history
Co-authored-by: mlloydbixal <[email protected]>
  • Loading branch information
rayestrada and mlloydbixal authored Jun 6, 2023
1 parent 71e2517 commit bd3bb4a
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 0 deletions.
1 change: 1 addition & 0 deletions assets/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ $theme-show-notifications: false,
@forward 'pages/homepage';
@forward 'pages/state-page';
@forward 'pages/basic-page';
@forward 'pages/sitemap';

@forward 'global/colors';
@forward 'global/typography';
Expand Down
16 changes: 16 additions & 0 deletions assets/styles/pages/sitemap.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@use 'uswds-core' as *;
@use '../mixins' as *;

.sitemap {
ul.main-nav, ul.register-nav {
list-style-type: none;
}

ul.register-nav {
columns: 2;

@include at-media('tablet') {
columns: 3;
}
}
}
11 changes: 11 additions & 0 deletions content/en/sitemap.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
+++
title = "Sitemap"
meta_title = "State Voting Resource Links - HTML Sitemap | Vote.gov"
meta_description = "View and access all state voting resource links on the Vote.gov HTML Sitemap."
translationKey = "sitemap"
home_link_title = "Homepage"
main_nav_header = "Main Navigation"
states_header = "Register to Vote - by State and Territory"
+++

{{< sitemap >}}
File renamed without changes.
1 change: 1 addition & 0 deletions data/translations/en/footer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"identifier_link_5": "Office of the Inspector General",
"identifier_link_6": "Performance Reports",
"identifier_link_7": "Privacy Policy",
"identifier_link_8": "Sitemap",
"identifier_more_info_aria": "Government information and services",
"identifier_more_info": "Looking for U.S. government information and services? %link%",
"identifier_more_info__1": "Visit USA.gov",
Expand Down
3 changes: 3 additions & 0 deletions layouts/partials/contact-identifier.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
<div class="tablet:grid-col-3">
<ul class="usa-list usa-list--unstyled identifier-links">
<li><a href="{{ $privacy_policy }}">{{ $translation.footer.identifier_link_7 }}</a></li>
{{ if $translation.footer.identifier_link_8 }}
<li><a href="{{ .Site.BaseURL }}/sitemap">{{ $translation.footer.identifier_link_8 }}</a></li>
{{ end }}
</ul>
</div>
</nav>
Expand Down
25 changes: 25 additions & 0 deletions layouts/shortcodes/sitemap.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{ $translation := ( index $.Site.Data.translations .Site.Language.Lang ) }}
{{ $envURL := ( index .Site.Params.envURL (os.Getenv "BRANCH") ) }}
{{ $envURL := cond (eq $envURL nil) .Site.Params.envURL.fed $envURL }}

<div class="sitemap">
<h2>{{ .Page.Params.main_nav_header }}</h2>
<ul class="main-nav usa-list">
<li><a hreflang="{{ $translation.Language.Lang }}" href="{{ .Site.Home.RelPermalink }}">{{ .Page.Params.home_link_title }}</a></li>
{{ range where .Site.RegularPages "Section" "!=" .Site.Params.register_path }}
{{ if ne .Title "Sitemap" }}
<li><a hreflang="{{ .Language.Lang }}" href="{{ .Permalink }}">{{ .Title }}</a></li>
{{ end }}
{{ end }}
</ul>

<h2>{{ .Page.Params.states_header }}</h2>
<ul class="register-nav usa-list">
{{ $states := where .Site.Pages "Section" .Site.Params.register_path }}
{{ range ($states.ByParam "state_name") }}
<li><a hreflang="{{ .Language.Lang }}" href="{{ .Permalink }}">
{{ .Params.state_name }}
</a></li>
{{ end }}
</ul>
</div>

0 comments on commit bd3bb4a

Please sign in to comment.