From a43342710a0f90e7e8834a3efae38f3d1e58d009 Mon Sep 17 00:00:00 2001 From: Luc Sarzyniec Date: Sun, 10 Feb 2019 15:00:41 +0100 Subject: [PATCH] Fix: headers and footers are not generated dynamically anymore The minimal-mistakes theme is using the "jekyll-include-cache" plugin since version 4.14.0 (see https://github.com/mmistakes/minimal-mistakes/pull/1874). This change breaks some dynamically generated content, i.e. content generated from _includes/head/custom.html and _includes/footer.html. This commit adds a plugin that monkey patches the "include_cached" tag of "jekyll-include-cache" to disable the caching feature and make it work as Jekyll's "include" tag. --- _plugins/disable-include_cached-tag.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 _plugins/disable-include_cached-tag.rb diff --git a/_plugins/disable-include_cached-tag.rb b/_plugins/disable-include_cached-tag.rb new file mode 100644 index 00000000..6ed6e42b --- /dev/null +++ b/_plugins/disable-include_cached-tag.rb @@ -0,0 +1,12 @@ +require "jekyll" + +# The minimal-mistakes theme is using the "jekyll-include-cache" plugin since +# version 4.14.0 (see https://github.com/mmistakes/minimal-mistakes/pull/1874). +# +# This change breaks some dynamically generated content, i.e. content +# generated from _includes/head/custom.html and _includes/footer.html. +# +# This plugin monkey patches the "include_cached" tag of "jekyll-include-cache" +# to disable the caching feature and make it work as Jekyll's "include" tag. + +Liquid::Template.register_tag("include_cached", Jekyll::Tags::IncludeTag)