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

VOTE-943 configure and style the sitemap #610

Merged
merged 1 commit into from
Mar 15, 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
4 changes: 2 additions & 2 deletions config/sync/block.block.votegov_htmlsitemap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ settings:
label_display: '0'
provider: system
level: 1
depth: 1
expand_all_items: false
depth: 3
expand_all_items: true
only_translated_labels: 0
only_translated_content: 0
visibility: { }
10 changes: 8 additions & 2 deletions config/sync/views.view.sitemap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ status: true
dependencies:
config:
- node.type.state_territory
- system.menu.footer
module:
- node
- user
Expand Down Expand Up @@ -241,7 +240,14 @@ display:
groups:
1: AND
style:
type: default
type: html_list
options:
grouping: { }
row_class: ''
default_row_class: false
type: ul
wrapper_class: ''
class: 'usa-list usa-list--unstyled'
row:
type: fields
query:
Expand Down
3 changes: 2 additions & 1 deletion web/themes/custom/votegov/src/sass/components/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
@forward "feature-cards";
@forward "quick-links";
@forward "basic";
@forward "registration-tool"
@forward "registration-tool";
@forward "sitemap";

22 changes: 22 additions & 0 deletions web/themes/custom/votegov/src/sass/components/sitemap.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@use "uswds-core" as *;

.vote-sitemap {
@include u-margin-y(4);

li > ul {
@include u-margin-y(2);
}
}

.vote-sitemap--register {
ul {
@include at-media('mobile-lg') {
column-count: 2;
column-gap: 2rem;
}

@include at-media('tablet-lg') {
column-count: 3;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div class="sitemap">
{{ drupal_entity('block', 'htmlsitemap') }}
</div>
<nav class="vote-sitemap vote-sitemap--menu">
{{ drupal_entity('block', 'votegov_htmlsitemap') }}
</nav>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{% import _self as menus %}

{{ menus.menu_links(items, 0) }}

{% macro menu_links(items, menu_level) %}
{% import _self as menus %}
{% if items %}
{% if menu_level == 0 %}
<ul class="usa-list usa-list--unstyled">
{% else %}
<ul>
{% endif %}
{% for item in items %}
<li>{{ link(item.title, item.url) }}
{% if item.below %}
{{ menus.menu_links(item.below, menu_level + 1) }}
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
{% endmacro %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{#
/**
* @file
* Theme override for a main view:sitemap template.
*/
#}
<nav class="vote-sitemap vote-sitemap--register">
{% if rows %}
{{ rows }}
{% elseif empty %}
{{ empty }}
{% endif %}
</nav>