From 22cab615d9fd6cfa75cc3d6c2aceb0e2c6b61c0b Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Thu, 4 Oct 2018 15:32:10 -0400 Subject: [PATCH 1/3] Add jekyll-include-cache plugin --- _config.yml | 2 ++ docs/_config.yml | 2 ++ minimal-mistakes-jekyll.gemspec | 1 + test/_config.yml | 2 ++ 4 files changed, 7 insertions(+) diff --git a/_config.yml b/_config.yml index 502dfd3d69d0..08264e5e90c0 100644 --- a/_config.yml +++ b/_config.yml @@ -226,6 +226,7 @@ plugins: - jekyll-gist - jekyll-feed - jemoji + - jekyll-include-cache # mimic GitHub Pages with --safe whitelist: @@ -234,6 +235,7 @@ whitelist: - jekyll-gist - jekyll-feed - jemoji + - jekyll-include-cache # Archives diff --git a/docs/_config.yml b/docs/_config.yml index 16c47aeb6a26..4f087b6dc996 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -284,6 +284,7 @@ plugins: - jekyll-gist - jekyll-feed - jemoji + - jekyll-include-cache # mimic GitHub Pages with --safe whitelist: @@ -292,6 +293,7 @@ whitelist: - jekyll-gist - jekyll-feed - jemoji + - jekyll-include-cache # Archives diff --git a/minimal-mistakes-jekyll.gemspec b/minimal-mistakes-jekyll.gemspec index 19e1d2164e4a..5d9736163cac 100644 --- a/minimal-mistakes-jekyll.gemspec +++ b/minimal-mistakes-jekyll.gemspec @@ -22,6 +22,7 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency "jekyll-feed", "~> 0.10" spec.add_runtime_dependency "jekyll-data", "~> 1.0" spec.add_runtime_dependency "jemoji", "~> 0.10" + spec.add_runtime_dependency "jekyll-include-cache", "~> 0.1" spec.add_development_dependency "bundler", "~> 1.15" spec.add_development_dependency "rake", "~> 10.0" diff --git a/test/_config.yml b/test/_config.yml index f9995e48cd96..331a33d38cc8 100644 --- a/test/_config.yml +++ b/test/_config.yml @@ -200,6 +200,7 @@ plugins: - jekyll-gist - jekyll-feed - jemoji + - jekyll-include-cache # mimic GitHub Pages with --safe whitelist: @@ -208,6 +209,7 @@ whitelist: - jekyll-gist - jekyll-feed - jemoji + - jekyll-include-cache # Archives From f0708e829d3c33cd30a26b3de08185dda3407b10 Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Thu, 4 Oct 2018 15:35:01 -0400 Subject: [PATCH 2/3] Cache "static" includes to improve build performance "Static" refers to those includes that don't rely on data passed from the page content. --- _includes/scripts.html | 10 +++++----- _layouts/default.html | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/_includes/scripts.html b/_includes/scripts.html index 9e92f42fe5c7..8d2b30f4982b 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -16,13 +16,13 @@ {%- assign search_provider = site.search_provider | default: "lunr" -%} {%- case search_provider -%} {%- when "lunr" -%} - {% include search/lunr-search-scripts.html %} + {% include_cached search/lunr-search-scripts.html %} {%- when "google" -%} - {% include search/google-search-scripts.html %} + {% include_cached search/google-search-scripts.html %} {%- when "algolia" -%} - {% include search/algolia-search-scripts.html %} + {% include_cached search/algolia-search-scripts.html %} {%- endcase -%} {% endif %} -{% include analytics.html %} -{% include /comments-providers/scripts.html %} +{% include_cached analytics.html %} +{% include_cached /comments-providers/scripts.html %} diff --git a/_layouts/default.html b/_layouts/default.html index 5d66a7ee14ee..c699dc2148ab 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -16,8 +16,8 @@ - {% include browser-upgrade.html %} - {% include masthead.html %} + {% include_cached browser-upgrade.html %} + {% include_cached masthead.html %}
{{ content }} @@ -25,18 +25,18 @@ {% if site.search == true %}
- {% include search/search_form.html %} + {% include_cached search/search_form.html %}
{% endif %} - {% include scripts.html %} + {% include_cached scripts.html %} \ No newline at end of file From 6afe3ead149e3e4f76fff1917280487900481fab Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Thu, 4 Oct 2018 15:41:40 -0400 Subject: [PATCH 3/3] Update CHANGELOG and history --- CHANGELOG.md | 1 + docs/_docs/18-history.md | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bfdb4a600b92..50826973c88b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### Enhancements +- Cache "static" includes to improve build performance. [#1874](https://github.com/mmistakes/minimal-mistakes/pull/1874) - Make entire feature and archive items "clickable". [#1864](https://github.com/mmistakes/minimal-mistakes/pull/1864) - Allow custom Staticman endpoints. [#1842](https://github.com/mmistakes/minimal-mistakes/issues/1842) - Remove `type="text/css"` from Algolia script includes. [#1836](https://github.com/mmistakes/minimal-mistakes/pull/1836) diff --git a/docs/_docs/18-history.md b/docs/_docs/18-history.md index 25783c94e82f..990e44891d49 100644 --- a/docs/_docs/18-history.md +++ b/docs/_docs/18-history.md @@ -4,7 +4,7 @@ permalink: /docs/history/ excerpt: "Change log of enhancements and bug fixes made to the theme." sidebar: nav: docs -last_modified_at: 2018-10-02T11:03:51-04:00 +last_modified_at: 2018-10-04T15:41:33-04:00 toc: true --- @@ -12,6 +12,7 @@ toc: true ### Enhancements +- Cache "static" includes to improve build performance. [#1874](https://github.com/mmistakes/minimal-mistakes/pull/1874) - Make entire feature and archive items "clickable". [#1864](https://github.com/mmistakes/minimal-mistakes/pull/1864) - Allow custom Staticman endpoints. [#1842](https://github.com/mmistakes/minimal-mistakes/issues/1842) - Remove `type="text/css"` from Algolia script includes. [#1836](https://github.com/mmistakes/minimal-mistakes/pull/1836)