diff --git a/_config.yml b/_config.yml index a090670..3820644 100644 --- a/_config.yml +++ b/_config.yml @@ -38,15 +38,28 @@ 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 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 # Google Analytics Tracking (optional) # e.g, UA-1234567-89 ga_tracking: UA-2709176-10 +ga_tracking_anonymize_ip: true # Use GDPR compliant Google Analytics settings (true by default) plugins: - jekyll-seo-tag diff --git a/_includes/head.html b/_includes/head.html index eae6a5e..a419dab 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 %} @@ -21,7 +21,7 @@ function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); - gtag('config', "{{ site.ga_tracking }}"); + gtag('config', '{{ site.ga_tracking }}'{% unless site.ga_tracking_anonymize_ip == nil %}, { 'anonymize_ip': true }{% endunless %}); {% endif %} 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 -%} diff --git a/_layouts/default.html b/_layouts/default.html index b1d3c72..13a860f 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -86,10 +86,29 @@ 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 %}
{% endif %} diff --git a/docs/configuration.md b/docs/configuration.md index eb43a08..d29d599 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 MIT license." + +# 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 @@ -85,4 +103,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 # Use GDPR compliant Google Analytics settings (true by default) ``` diff --git a/just-the-docs.gemspec b/just-the-docs.gemspec index a426d4e..239b479 100644 --- a/just-the-docs.gemspec +++ b/just-the-docs.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "just-the-docs" - spec.version = "0.2.8" + spec.version = "0.2.9" spec.authors = ["Patrick Marsceill"] spec.email = ["patrick.marsceill@gmail.com"] @@ -13,7 +13,7 @@ Gem::Specification.new do |spec| spec.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(assets|bin|_layouts|_includes|lib|Rakefile|_sass|LICENSE|README)}i) } spec.executables << 'just-the-docs' - spec.add_runtime_dependency "bundler", "~> 2.1.4" + spec.add_development_dependency "bundler", "~> 2.1.4" spec.add_runtime_dependency "jekyll", ">= 3.8.5", "< 4.1.0" spec.add_runtime_dependency "jekyll-seo-tag", "~> 2.0" spec.add_runtime_dependency "rake", ">= 12.3.1", "< 13.1.0" diff --git a/package.json b/package.json index a9fd8e1..c2ab5ff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "just-the-docs", - "version": "0.2.8", + "version": "0.2.9", "description": "A modern Jekyll theme for documentation", "repository": "pmarsceill/just-the-docs", "license": "MIT",