diff --git a/_config.yml b/_config.yml index a09067082833b73ec56343a3d45170ce95c9c2af..9973afeb17da36e78b2dd31ccfabefee87e05d67 100644 --- a/_config.yml +++ b/_config.yml @@ -38,9 +38,21 @@ aux_links: "Just the Docs on GitHub": - "//github.com/pmarsceill/just-the-docs" -# Footer content appears at the bottom of every page's main 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>" +# 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 + +# Footer "Edit this page on GitHub" link text +gh_edit_link: true # show or hide edit this page link +gh_edit_link_text: "Edit this page on GitHub." +gh_edit_repository: "https://github.com/pmarsceill/just-the-docs" # the github URL for your repo +gh_edit_branch: "master" # the branch that your docs is served from +gh_edit_view_mode: "tree" # "tree" or "edit" if you want the user to jump into the editor immediately + # Color scheme currently only supports "dark" or nil (default) color_scheme: nil diff --git a/_layouts/default.html b/_layouts/default.html index b1d3c72435399b13422a79b7a36b51258cb5e8cf..13a860f354fb83b2a5903170199a701b42ec1e0d 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -86,10 +86,29 @@ layout: table_wrappers </ul> {% endif %} - {% if site.footer_content != nil %} + {% if site.footer_content != nil or site.show_last_edit_time or site.show_gh_edit_link %} <hr> <footer role="contentinfo"> + {% if site.last_edit_timestamp and site.last_edit_time_format and page.last_modified_date %} + <p class="text-small text-grey-dk-000 mb-0"> + Page last modified: {{ page.last_modified_date | date: site.last_edit_time_format }}. + </p> + {% endif %} + {% + if + site.gh_edit_link and + site.gh_edit_link_text and + site.gh_edit_repository and + site.gh_edit_view_mode and + site.gh_edit_branch + %} + <p class="text-small text-grey-dk-000 mb-0"> + <a href="{{ site.gh_edit_repository }}/{{site.gh_edit_view_mode}}/{{site.gh_edit_branch}}/{{ page.path }}">{{ site.edit_link_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> {% endif %} diff --git a/docs/configuration.md b/docs/configuration.md index eb43a086f9572ed1fb249ab1fc483eeb0929dba3..98fecdbba2ad84b5448c5a13fd765659f14a06b8 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -63,10 +63,28 @@ heading_anchors: true ## Footer content ```yaml -# Footer content appears at the bottom of every page's main 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>" + +# 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 + +# Footer "Edit this page on GitHub" link text +gh_edit_link: true # show or hide edit this page link +gh_edit_link_text: "Edit this page on GitHub." +gh_edit_repository: "https://github.com/pmarsceill/just-the-docs" # the github URL for your repo +gh_edit_branch: "master" # the branch that your docs is served from +gh_edit_view_mode: "tree" # "tree" or "edit" if you want the user to jump into the editor immediately ``` +- the "page last modified" data will only display if a page has a key called `last_modified_date`, formatted in some readable date format +- `last_edit_time_format` uses Ruby's DateTime formatter; see examples and more information [at this link.](https://apidock.com/ruby/DateTime/strftime) +- `gh_edit_repository` is the URL of the project's GitHub repository +- `gh_edit_branch` is the branch that the docs site is served from; defaults to `master` +- `gh_edit_view_mode` is `"tree"` by default, which brings the user to the github page; switch to `"edit"` to bring the user directly into editing mode + ## Color scheme ```yaml