From 218cd29f8fe59cffba872523962ce88df9e2d317 Mon Sep 17 00:00:00 2001 From: Ryan Hofschneider Date: Mon, 31 Aug 2020 19:35:07 -0700 Subject: [PATCH] Tweak the footer/anchor API - Restore the ability to display the standard uswds-jekyll footer - Explicitly turn the standard footer off - Structure the anchor.yml edit_page key like the footer.yml one - Disable the anchor last_updated, edit_page if footer enabled --- _data/footer.yml | 2 ++ _data/override/anchor.yml | 3 ++- _includes/footer.html | 47 +++++++++++++++++++++++++-------------- 3 files changed, 34 insertions(+), 18 deletions(-) create mode 100644 _data/footer.yml diff --git a/_data/footer.yml b/_data/footer.yml new file mode 100644 index 0000000..a92b699 --- /dev/null +++ b/_data/footer.yml @@ -0,0 +1,2 @@ +# Explicitly disable footer; only using anchor +type: diff --git a/_data/override/anchor.yml b/_data/override/anchor.yml index c2e2a4c..286b2cf 100644 --- a/_data/override/anchor.yml +++ b/_data/override/anchor.yml @@ -1,2 +1,3 @@ -edit_page: true +edit_page: + text: "Edit this page" last_updated: true diff --git a/_includes/footer.html b/_includes/footer.html index 04749fc..6f0f3ca 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -1,26 +1,39 @@ +{% assign footer = site.data.footer %} + +{% if footer.type == 'slim' %} + {% include components/footer--slim.html %} +{% elsif footer.type == 'default' or footer.type == 'medium' %} + {% include components/footer--default.html %} +{% elsif footer.type == 'big' %} + {% include components/footer--big.html %} +{% endif %} + {% assign anchor = site.data.anchor %} +
{% if anchor.edit_page or (anchor.last_updated and page.last_modified_at) %} -
-
-
-
-
-

- {% if anchor.last_updated and page.last_modified_at %} - Last updated: {{ page.last_modified_at | date: '%B %d, %Y' }} - {% endif %} - {% if anchor.edit_page %} - - {% include components/github-edit.html footer=footer path=page.path %} - - {% endif %} -

+ {% unless footer.type %} +
+
+
+
+
+

+ {% if anchor.last_updated and page.last_modified_at %} + Last updated: {{ page.last_modified_at | date: '%B %d, %Y' }} + {% endif %} + {% if anchor.edit_page %} + + {% include components/github-edit.html footer=anchor path=page.path %} + + {% endif %} +

+
+
-
-
+ {% endunless %} {% endif %}