Skip to content

Commit 3e5ab87

Browse files
author
Scott Weber
authored
Merge pull request #114 from 18F/sw-footer-updates
Updating the default footer to closer match the USWDS
2 parents cfdc5a9 + abf5f3d commit 3e5ab87

3 files changed

Lines changed: 53 additions & 25 deletions

File tree

_data/footer.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# This is the configuration for the site footer.
22

3+
# this defines the type of footer
4+
# header types can be only be medium at the moment
5+
type: medium
6+
37
# Used to show the "Return to top" link; can also be
48
# configured as an object with 'text' and 'href' properties.
59
top:
@@ -25,15 +29,28 @@ logos:
2529
alt: 18F
2630
external: true
2731

32+
# This controls the contact section of the footer
2833
contact:
29-
links:
30-
- text: USA
34+
heading: Agency contact center
35+
social_links:
36+
- text: Facebook
37+
href: https://facebook.com
38+
external: true
39+
type: facebook
40+
- text: Twitter
41+
href: https://twitter.com
42+
external: true
43+
type: twitter
44+
- text: YouTube
45+
href: https://youtube.com
46+
external: true
47+
type: youtube
48+
- text: RSS Feed
3149
href: https://usa.gov/
3250
external: true
33-
34-
heading: Contact us
35-
36-
address: |
37-
[GitHub](https://github.com/uswds/uswds)
38-
39-
[uswds@gsa.gov](mailto:uswds@gsa.gov)
51+
type: rss
52+
contact_links:
53+
- text: (800) CALL-GOVT
54+
href: tel:1-800-555-5555
55+
- text: info@agency.gov
56+
href: mailto:info@agency.gov
Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@
4141
{% if footer.logos %}
4242
{% for logo in footer.logos -%}
4343
{% if logo.url %}
44-
<a href="{{ logo.url }}">
44+
<a href="{{ logo.url }}">
4545
{% endif %}
46-
<img class="usa-footer-logo-img" src="{% if logo.external %}{{ logo.src }}{% else %}{{ logo.src | relative_url }}{% endif %}" alt="{{ logo.alt }}"{% if logo.width %}width="{{ logo.width }}"{% endif %}{% if logo.height %}height="{{ logo.height }}"{% endif %}>
46+
<img class="usa-footer-logo-img" src="{% if logo.external %}{{ logo.src }}{% else %}{{ logo.src | relative_url }}{% endif %}" alt="{{ logo.alt }}"{% if logo.width %}width="{{ logo.width }}"{% endif %}{% if logo.height %}height="{{ logo.height }}"{% endif %}>
4747
{% if logo.url %}
48-
</a>
48+
</a>
4949
{% endif %}
5050
{% endfor %}
5151
{% endif %}
@@ -57,20 +57,30 @@ <h3 class="usa-footer-logo-heading">{{ footer.heading }}</h3>
5757

5858
{% if footer.contact %}
5959
<div class="usa-footer-contact-links usa-width-one-half">
60-
{% assign contact_links = site.data.navigation[footer.contact.links] | default: footer.contact.links %}
61-
{% for _link in contact_links %}
62-
<a class="usa-link-{{ _link.type | default: 'generic' }}" href="{% if _link.external == true %}{{ _link.href }}{% else %}{{ _link.href | relative_url }}{% endif %}">
63-
<span>{{ _link.text }}</span>
64-
</a>
65-
{% endfor %}
66-
67-
{% if footer.contact.address %}
68-
<address>
69-
{% if footer.contact.heading %}
60+
{% assign social_links = site.data.footer.contact.social_links %}
61+
{% if footer.contact.contact_links %}
62+
{% for _link in social_links %}
63+
<a class="usa-link-{{ _link.type | default: 'generic' }}" href="{% if _link.external == true %}{{ _link.href }}{% else %}{{ _link.href | relative_url }}{% endif %}">
64+
<span>{{ _link.text }}</span>
65+
</a>
66+
{% endfor %}
67+
{% endif %}
68+
{% if footer.contact.heading %}
7069
<h3 class="usa-footer-contact-heading">{{ footer.contact.heading }}</h3>
7170
{% endif %}
72-
{{ footer.contact.address | markdownify }}
73-
</address>
71+
{% if footer.contact.contact_links %}
72+
<address>
73+
{% assign contact_links = site.data.footer.contact.contact_links %}
74+
{% for _link in contact_links %}
75+
<div class="usa-footer-primary-content usa-footer-contact_info">
76+
<p>
77+
<a href="{% if _link.external == true %}{{ _link.href }}{% else %}{{ _link.href | relative_url }}{% endif %}">
78+
{{ _link.text }}
79+
</a>
80+
</p>
81+
</div>
82+
{% endfor %}
83+
</address>
7484
{% endif %}
7585
{% endif %}
7686
</div>

_includes/footer.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
{% assign footer = site.data.footer %}
2-
{% include components/footer.html %}
2+
3+
{% include components/footer--medium.html %}

0 commit comments

Comments
 (0)