From cd192aa4e2bfd1246e2be335733264a7a917193f Mon Sep 17 00:00:00 2001 From: CodeSandwich <igor.zuk@protonmail.com> Date: Fri, 5 Jun 2020 01:07:16 +0200 Subject: [PATCH] Add custom header and footer include files --- _includes/footer_custom.html | 3 +++ _includes/header_custom.html | 0 _layouts/default.html | 11 +++++++---- docs/configuration.md | 4 +++- 4 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 _includes/footer_custom.html create mode 100644 _includes/header_custom.html diff --git a/_includes/footer_custom.html b/_includes/footer_custom.html new file mode 100644 index 00000000..565317a4 --- /dev/null +++ b/_includes/footer_custom.html @@ -0,0 +1,3 @@ +{%- if site.footer_content -%} + <p class="text-small text-grey-dk-000 mb-0">{{ site.footer_content }}</p> +{%- endif -%} diff --git a/_includes/header_custom.html b/_includes/header_custom.html new file mode 100644 index 00000000..e69de29b diff --git a/_layouts/default.html b/_layouts/default.html index 1d41a711..8a98f214 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -65,6 +65,7 @@ layout: table_wrappers <div id="search-results" class="search-results"></div> </div> {% endif %} + {% include header_custom.html %} {% if site.aux_links %} <nav aria-label="Auxiliary" class="aux-nav"> <ul class="aux-nav-list"> @@ -119,15 +120,17 @@ layout: table_wrappers </ul> {% endif %} - {% if site.footer_content != nil or site.last_edit_timestamp or site.gh_edit_link %} + {% capture footer_custom %} + {%- include footer_custom.html -%} + {% endcapture %} + {% if footer_custom != "" or site.last_edit_timestamp or site.gh_edit_link %} <hr> <footer> {% if site.back_to_top %} <p><a href="#top" id="back-to-top">{{ site.back_to_top_text }}</a></p> {% endif %} - {% if site.footer_content != nil %} - <p class="text-small text-grey-dk-000 mb-0">{{ site.footer_content }}</p> - {% endif %} + + {{ footer_custom }} {% if site.last_edit_timestamp or site.gh_edit_link %} <div class="d-flex mt-2"> diff --git a/docs/configuration.md b/docs/configuration.md index 65471d23..1957c2b9 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -86,10 +86,12 @@ heading_anchors: true ## Footer content ```yaml -# Footer content +# Footer content # appears at the bottom of every page's main content footer_content: "Copyright © 2017-2019 Patrick Marsceill. Distributed by an <a href=\"https://github.com/pmarsceill/just-the-docs/tree/master/LICENSE.txt\">MIT license.</a>" +This option is deprecated and will be removed in a future major release. Please use `footer_custom.html`. + # Footer last edited timestamp last_edit_timestamp: true # show or hide edit time - page must have `last_modified_date` defined in the frontmatter last_edit_time_format: "%b %e %Y at %I:%M %p" # uses ruby's time format: https://ruby-doc.org/stdlib-2.7.0/libdoc/time/rdoc/Time.html -- GitLab