From 8b8f0f4a0db06d8d20396ddf52e3f5528316b4e7 Mon Sep 17 00:00:00 2001 From: Basanta Khakurel Date: Tue, 21 Apr 2026 11:20:31 +0200 Subject: [PATCH] optimize Jekyll partial rendering with include_cached --- Gemfile | 1 + Gemfile.lock | 3 +++ _config.yml | 2 +- _includes/javascript.html | 4 ++-- _includes/navbar.html | 2 +- _layouts/default.html | 13 +++++++---- _layouts/help.html | 2 +- _plugins/filters.rb | 47 +++++++++++++++++++++++++++++---------- _plugins/snippet.rb | 4 +++- 9 files changed, 56 insertions(+), 22 deletions(-) diff --git a/Gemfile b/Gemfile index 7c7f9e791..1f603917c 100644 --- a/Gemfile +++ b/Gemfile @@ -21,6 +21,7 @@ gem "observer" group :jekyll_plugins do gem 'jekyll-scholar' gem 'jekyll-last-modified-at' + gem 'jekyll-include-cache' end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem diff --git a/Gemfile.lock b/Gemfile.lock index cd0d38bcb..502f12891 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -100,6 +100,8 @@ GEM safe_yaml (~> 1.0) terminal-table (>= 1.8, < 4.0) webrick (~> 1.7) + jekyll-include-cache (0.2.1) + jekyll (>= 3.7, < 5.0) jekyll-last-modified-at (1.3.2) jekyll (>= 3.7, < 5.0) jekyll-sass-converter (3.1.0) @@ -209,6 +211,7 @@ DEPENDENCIES base64 csv jekyll + jekyll-include-cache jekyll-last-modified-at jekyll-scholar observer diff --git a/_config.yml b/_config.yml index 0d6e1a3d9..b2726b686 100644 --- a/_config.yml +++ b/_config.yml @@ -17,7 +17,7 @@ baseurl: "" helpdir: "documentation" version: v1.4.0 -plugins: ['jekyll/scholar'] +plugins: ['jekyll/scholar', 'jekyll-include-cache'] include: [.nojekyll] exclude: diff --git a/_includes/javascript.html b/_includes/javascript.html index dc33d5a4f..15b46e7c1 100644 --- a/_includes/javascript.html +++ b/_includes/javascript.html @@ -6,9 +6,9 @@