From 7c8ead0bff574e80542a3132d377e53d92332dbb Mon Sep 17 00:00:00 2001 From: Matthew Wang Date: Mon, 9 Sep 2019 19:31:23 -0700 Subject: [PATCH 01/23] adds page last modified to footer --- _layouts/default.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/_layouts/default.html b/_layouts/default.html index d414234..de5244e 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -83,6 +83,9 @@ layout: table_wrappers {% if site.footer_content != nil %}
{% endif %} From be5822cb860e695eabc3368867d38f569bb93f19 Mon Sep 17 00:00:00 2001 From: Matthew Wang Date: Mon, 9 Sep 2019 19:43:33 -0700 Subject: [PATCH 02/23] adds page last modified above header --- _layouts/default.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/_layouts/default.html b/_layouts/default.html index de5244e..d56132e 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -59,6 +59,9 @@ layout: table_wrappers {% endif %} {% endunless %}
+ {% if page.last_modified_date %} +

Page last modified: {{ page.last_modified_date | date: "%Y-%m-%d %H:%M" }}

+ {% endif %} {% if site.heading_anchors != false %} {% include vendor/anchor_headings.html html=content beforeHeading = "true" anchorBody="" anchorClass="anchor-heading" %} {% else %} From 97efc81fa904054e367d9fb1f5df7f11e2a90e6b Mon Sep 17 00:00:00 2001 From: Matthew Wang Date: Wed, 11 Sep 2019 15:31:47 -0700 Subject: [PATCH 03/23] implements configuration for footer data and "edit this page" functionality --- _config.yml | 6 ++++++ _layouts/default.html | 14 +++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/_config.yml b/_config.yml index d12d439..cab96f5 100644 --- a/_config.yml +++ b/_config.yml @@ -34,6 +34,12 @@ aux_links: # Footer content appears at the bottom of every page's main content footer_content: "Copyright © 2017-2019 Patrick Marsceill. Distributed by an MIT license." +# Footer metadata +show_last_edit_time: true +last_edit_time_format: "%b %e %Y at %I:%M %p" +show_gh_edit_link: true +gh_edit_repository: "https://github.com/pmarsceill/just-the-docs" +edit_link_text: "Edit this page on GitHub" # Color scheme currently only supports "dark" or nil (default) color_scheme: nil diff --git a/_layouts/default.html b/_layouts/default.html index d56132e..e7d4996 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -59,9 +59,6 @@ layout: table_wrappers {% endif %} {% endunless %}
- {% if page.last_modified_date %} -

Page last modified: {{ page.last_modified_date | date: "%Y-%m-%d %H:%M" }}

- {% endif %} {% if site.heading_anchors != false %} {% include vendor/anchor_headings.html html=content beforeHeading = "true" anchorBody="" anchorClass="anchor-heading" %} {% else %} @@ -86,8 +83,15 @@ layout: table_wrappers {% if site.footer_content != nil %}
- {% if page.last_modified_date %} -

Page last modified: {{ page.last_modified_date | date: "%Y-%m-%d %H:%M" }}

+ {% if site.show_last_edit_time and site.last_edit_time_format and page.last_modified_date %} +

+ Page last modified: {{ page.last_modified_date | date: site.last_edit_time_format }}. +

+ {% endif %} + {% if site.show_gh_edit_link and site.edit_link_text %} +

+ Edit this page on GitHub. +

{% endif %}

{{ site.footer_content }}

From 4ff38dbe9c8090ea31bcb39927d8ba7d0ffcff99 Mon Sep 17 00:00:00 2001 From: Matthew Wang Date: Wed, 11 Sep 2019 15:36:36 -0700 Subject: [PATCH 04/23] adds documentation --- docs/configuration.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/configuration.md b/docs/configuration.md index 14422fd..1a443c9 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -55,8 +55,18 @@ heading_anchors: true ```yaml # Footer content appears at the bottom of every page's main content footer_content: "Copyright © 2017-2019 Patrick Marsceill. Distributed by an MIT license." +# Footer metadata +show_last_edit_time: true +last_edit_time_format: "%b %e %Y at %I:%M %p" +show_gh_edit_link: true +gh_edit_repository: "https://github.com/pmarsceill/just-the-docs" +edit_link_text: "Edit this page on GitHub" ``` +* 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` should be changed to the project's GitHub repository + ## Color scheme ```yaml From 9c4622d75f5cfec36c3ce1950cbcb221aea6c9dc Mon Sep 17 00:00:00 2001 From: Matthew Wang Date: Sat, 14 Sep 2019 17:54:27 -0700 Subject: [PATCH 05/23] implements conditional or on footer --- _layouts/default.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/_layouts/default.html b/_layouts/default.html index 5bf27a9..9c333af 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -86,7 +86,7 @@ layout: table_wrappers {% endif %} - {% if site.footer_content != nil %} + {% if site.footer_content != nil or site.show_last_edit_time or site.show_gh_edit_link %}
{% if site.show_last_edit_time and site.last_edit_time_format and page.last_modified_date %} @@ -99,7 +99,9 @@ layout: table_wrappers Edit this page on GitHub.

{% endif %} + {% if site.footer_content != nil %}

{{ site.footer_content }}

+ {% endif %}
{% endif %} From 25331a5ffad215b86fcdf78067ee89b940147bc5 Mon Sep 17 00:00:00 2001 From: Alexey Averikhin Date: Fri, 8 Nov 2019 06:54:59 +0100 Subject: [PATCH 06/23] Enable IP anonymization in Google Analytics (GDPR) - Introduced "ga_tracking_anonymize_ip" parameter to enable/disable Google Analytics IP anonymization (to comply with GDPR). (cherry picked from commit ce530f36fa0549c78ffe53ea6077f44f6f0b330f) (+1 squashed commit) Squashed commits: [69b7718] - enable GA anonymize_ip (cherry picked from commit f2b67c632af72b61dd634b9a337200781519691e) --- _config.yml | 1 + _includes/head.html | 2 +- docs/configuration.md | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index a090670..5508d4a 100644 --- a/_config.yml +++ b/_config.yml @@ -47,6 +47,7 @@ color_scheme: nil # Google Analytics Tracking (optional) # e.g, UA-1234567-89 ga_tracking: UA-2709176-10 +ga_tracking_anonymize_ip: true plugins: - jekyll-seo-tag diff --git a/_includes/head.html b/_includes/head.html index eae6a5e..67e7b05 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -21,7 +21,7 @@ function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); - gtag('config', "{{ site.ga_tracking }}"); + gtag('config', '{{ site.ga_tracking }}'{% if site.ga_tracking_anonymize_ip %}, { 'anonymize_ip': true }{% endif %}); {% endif %} diff --git a/docs/configuration.md b/docs/configuration.md index eb43a08..23a0e26 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -85,4 +85,5 @@ See [Customization]({{ site.baseurl }}{% link docs/customization.md %}) for more # Google Analytics Tracking (optional) # e.g, UA-1234567-89 ga_tracking: UA-5555555-55 +ga_tracking_anonymize_ip: true ``` From 2c949289173da379d38868417ac8e66969b966d4 Mon Sep 17 00:00:00 2001 From: Matthew Wang Date: Wed, 13 Nov 2019 23:06:23 -0800 Subject: [PATCH 07/23] oops, adds edit_link_text to layout --- _config.yml | 2 +- _layouts/default.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_config.yml b/_config.yml index 09da13f..721cc74 100644 --- a/_config.yml +++ b/_config.yml @@ -45,7 +45,7 @@ show_last_edit_time: true last_edit_time_format: "%b %e %Y at %I:%M %p" show_gh_edit_link: true gh_edit_repository: "https://github.com/pmarsceill/just-the-docs" -edit_link_text: "Edit this page on GitHub" +edit_link_text: "Edit this page on GitHub." # Color scheme currently only supports "dark" or nil (default) color_scheme: nil diff --git a/_layouts/default.html b/_layouts/default.html index 9c333af..4496d9d 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -96,7 +96,7 @@ layout: table_wrappers {% endif %} {% if site.show_gh_edit_link and site.edit_link_text %}

- Edit this page on GitHub. + {{ site.edit_link_text }}

{% endif %} {% if site.footer_content != nil %} From 9b86e292fa1860820ede6531ed494c97ea6db444 Mon Sep 17 00:00:00 2001 From: Matthew Wang Date: Sun, 12 Jan 2020 13:47:05 -0800 Subject: [PATCH 08/23] implements requested branch and edit mode configs --- _config.yml | 6 ++++-- _layouts/default.html | 11 +++++++++-- docs/configuration.md | 12 ++++++++---- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/_config.yml b/_config.yml index 721cc74..4850575 100644 --- a/_config.yml +++ b/_config.yml @@ -42,9 +42,11 @@ aux_links: footer_content: "Copyright © 2017-2019 Patrick Marsceill. Distributed by an MIT license." # Footer metadata show_last_edit_time: true -last_edit_time_format: "%b %e %Y at %I:%M %p" +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 show_gh_edit_link: true -gh_edit_repository: "https://github.com/pmarsceill/just-the-docs" +gh_edit_repository: "https://github.com/pmarsceill/just-the-docs" # the github URL for your repo +gh_edit_branch: "master" # switch to the branch that your docs is served from +gh_edit_view_mode: "tree" # switch to "edit" if you want the user to jump into the editor immediately edit_link_text: "Edit this page on GitHub." # Color scheme currently only supports "dark" or nil (default) diff --git a/_layouts/default.html b/_layouts/default.html index 4496d9d..86f7469 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -94,9 +94,16 @@ layout: table_wrappers Page last modified: {{ page.last_modified_date | date: site.last_edit_time_format }}.

{% endif %} - {% if site.show_gh_edit_link and site.edit_link_text %} + {% + if + site.show_gh_edit_link and + site.edit_link_text and + site.gh_edit_repository and + site.gh_edit_view_mode and + site.gh_edit_branch + %}

- {{ site.edit_link_text }} + {{ site.edit_link_text }}

{% endif %} {% if site.footer_content != nil %} diff --git a/docs/configuration.md b/docs/configuration.md index 86dd7eb..74a0d0c 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -67,15 +67,19 @@ heading_anchors: true footer_content: "Copyright © 2017-2019 Patrick Marsceill. Distributed by an MIT license." # Footer metadata show_last_edit_time: true -last_edit_time_format: "%b %e %Y at %I:%M %p" +last_edit_time_format: "%b %e %Y at %I:%M %p" # uses ruby's time format show_gh_edit_link: true -gh_edit_repository: "https://github.com/pmarsceill/just-the-docs" -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" # switch to the branch that your docs is served from +gh_edit_view_mode: "tree" # switch to "edit" if you want the user to jump into the editor immediately +edit_link_text: "Edit this page on GitHub." ``` * 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` should be changed to the project's GitHub repository +* `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 From 6f2065aa57a1d3285a3b6c8f04a31785cc5f54af Mon Sep 17 00:00:00 2001 From: Scott V Kissinger Date: Wed, 19 Feb 2020 16:01:50 +0800 Subject: [PATCH 09/23] Update nav.html for handling nav_exclude It appears nav_exclude only works on top level navigation items. I needed it to work at the child level as well. I believe these changes accomplish that for the child and grand_child levels. Love this theme. I've used it a few times. Apologies if this pull request is not according to convention. This is the first time I've done it on someone else's code. Thanks! --- _includes/nav.html | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/_includes/nav.html b/_includes/nav.html index d561a42..8042aa4 100644 --- a/_includes/nav.html +++ b/_includes/nav.html @@ -13,22 +13,26 @@ {%- assign children_list = site.html_pages | where: "parent", node.title | sort:"nav_order" -%} {%- endif -%} From aa8ca74883243708f3203e7f659aafbbcbdc720e Mon Sep 17 00:00:00 2001 From: Serge Date: Sun, 22 Mar 2020 22:51:37 -0400 Subject: [PATCH 10/23] Fix duplicated title and description tags Currently just-the-docs renders two title and description tags when used with jekyll-seo-tag. This patch fixes plugin detection conditonal. --- _includes/head.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_includes/head.html b/_includes/head.html index eae6a5e..aebfaba 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -2,13 +2,13 @@ - {% if site.plugins.jekyll-seo == nil %} + {% unless site.plugins contains "jekyll-seo-tag" %} {{ page.title }} - {{ site.title }} {% if page.description %} {% endif %} - {% endif %} + {% endunless %} From 17153f001fa8979513f4bc0d9396b19262b2567e Mon Sep 17 00:00:00 2001 From: Patrick Marsceill Date: Thu, 23 Apr 2020 22:32:46 -0400 Subject: [PATCH 11/23] Update _config.yml --- _config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/_config.yml b/_config.yml index 4850575..014cf46 100644 --- a/_config.yml +++ b/_config.yml @@ -41,12 +41,12 @@ aux_links: # Footer content appears at the bottom of every page's main content footer_content: "Copyright © 2017-2019 Patrick Marsceill. Distributed by an MIT license." # Footer metadata -show_last_edit_time: true +show_last_edit_time: true # show (default) or hide edit time 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 -show_gh_edit_link: true +show_gh_edit_link: true # show (default) or hide edit this page link gh_edit_repository: "https://github.com/pmarsceill/just-the-docs" # the github URL for your repo -gh_edit_branch: "master" # switch to the branch that your docs is served from -gh_edit_view_mode: "tree" # switch to "edit" if you want the user to jump into the editor immediately +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 edit_link_text: "Edit this page on GitHub." # Color scheme currently only supports "dark" or nil (default) From 5d3b88a1e13ca09755f109c0e298a55e0c142d33 Mon Sep 17 00:00:00 2001 From: Patrick Marsceill Date: Thu, 23 Apr 2020 22:38:45 -0400 Subject: [PATCH 12/23] Update _config.yml --- _config.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/_config.yml b/_config.yml index 014cf46..fa93ad3 100644 --- a/_config.yml +++ b/_config.yml @@ -38,16 +38,20 @@ 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 MIT license." -# Footer metadata + +# Footer last edited timestamp show_last_edit_time: true # show (default) or hide edit time 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 -show_gh_edit_link: true # show (default) or hide edit this page link + +# 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 -edit_link_text: "Edit this page on GitHub." # Color scheme currently only supports "dark" or nil (default) color_scheme: nil From eecc51062bcbad5d54f8260f49bbde5fb4c1e991 Mon Sep 17 00:00:00 2001 From: Patrick Marsceill Date: Thu, 23 Apr 2020 22:39:11 -0400 Subject: [PATCH 13/23] Update default.html --- _layouts/default.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_layouts/default.html b/_layouts/default.html index 86f7469..0b714bc 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -96,8 +96,8 @@ layout: table_wrappers {% endif %} {% if - site.show_gh_edit_link and - site.edit_link_text and + 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 From 60756a592dd8b8a7bc6f799cf65c126ff742edb8 Mon Sep 17 00:00:00 2001 From: Patrick Marsceill Date: Thu, 23 Apr 2020 22:41:29 -0400 Subject: [PATCH 14/23] Update configuration.md --- docs/configuration.md | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index 74a0d0c..e0065df 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -63,23 +63,27 @@ 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 MIT license." -# Footer metadata -show_last_edit_time: true -last_edit_time_format: "%b %e %Y at %I:%M %p" # uses ruby's time format -show_gh_edit_link: true + +# Footer last edited timestamp +last_edit_timestamp: true # show (default) or hide edit time +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" # switch to the branch that your docs is served from -gh_edit_view_mode: "tree" # switch to "edit" if you want the user to jump into the editor immediately -edit_link_text: "Edit this page on GitHub." +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 +- 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 From 2faa91f2359b21de71fc9cec5836461114854899 Mon Sep 17 00:00:00 2001 From: Patrick Marsceill Date: Thu, 23 Apr 2020 22:42:00 -0400 Subject: [PATCH 15/23] Update default.html --- _layouts/default.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_layouts/default.html b/_layouts/default.html index 0b714bc..13a860f 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -89,7 +89,7 @@ layout: table_wrappers {% if site.footer_content != nil or site.show_last_edit_time or site.show_gh_edit_link %}