Skip to content

Commit f460e79

Browse files
author
Scott Weber
authored
Merge pull request #110 from 18F/sw-edit-page
Adding edit page link and adding page meta section
2 parents e394731 + a37f9bf commit f460e79

4 files changed

Lines changed: 28 additions & 11 deletions

File tree

_config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
title: This is the site title
22

3+
# GitHub information
4+
# This is used for adding an edit this page link to the footer
5+
github:
6+
organization: 18F
7+
repository: federalist-uswds-template
8+
default_branch: master
9+
310
# Configuration for Google Analytics, add your UA code here:
411
# google_analytics_ua: UA-????????-??
512

_data/footer.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ top:
1010
text: Return to top
1111
href: '#'
1212

13+
# Used to show an "Edit this page" link at the bottom of the page.
14+
# The text is configurable and the link is built from the _comfig.yml.
15+
# edit_page:
16+
# text: Edit this page
17+
1318
# Used to show the "Last updated" date and time;
1419
# last_updated: true
1520

_includes/components/footer--medium.html

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
{% if footer %}
2-
3-
{% if footer.last_updated %}
4-
{% include last-modified.html %}
5-
{% endif %}
6-
72
<footer class="usa-footer usa-footer-medium" role="contentinfo">
83

4+
{% if footer.last_updated %}
5+
<div class="usa-grid">
6+
<div class="usa-width-one-whole">
7+
<p>Last updated: {{ page.last_modified_at | date: '%B %d, %Y at %I:%M %p' }}</p>
8+
</div>
9+
</div>
10+
{% endif %}
11+
912
{% if footer.top %}
10-
<div class="usa-grid usa-footer-return-to-top">
11-
<a href="{{ footer.top.href | default: '#' }}">{{ footer.top.text | default: 'Return to top' }}</a>
12-
</div>
13+
<div class="usa-grid usa-footer-return-to-top">
14+
<a href="{{ footer.top.href | default: '#' }}">{{ footer.top.text | default: 'Return to top' }}</a>
15+
</div>
1316
{% endif %}
1417

18+
19+
1520
{% if footer.links %}
1621
{% assign footer_links = site.data.navigation[footer.links] | default: footer.links %}
1722
{% assign _sizes = 'whole half third fourth sixth' | split: ' ' %}
@@ -83,6 +88,9 @@ <h3 class="usa-footer-contact-heading">{{ footer.contact.heading }}</h3>
8388
</address>
8489
{% endif %}
8590
{% endif %}
91+
{% if footer.edit_page %}
92+
<small><a href="https://github.com/{{ site.github.organization }}/{{ site.github.repository }}/edit/{{ site.github.default_branch }}/{{ page.path }}" class="usa-sidenav-edit" target="_blank">{{ footer.edit_page.text | default: 'Edit this page' }}</a></small>
93+
{% endif %}
8694
</div>
8795
</div>
8896
</div>

_includes/last-modified.html

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)