diff --git a/.prettierignore b/.prettierignore
index ef61d8d..2929bf4 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -2,7 +2,6 @@
**/*.min.css
**/*.min.js
assets/css/main.scss
-assets/js/search-data.js
assets/js/distillpub/template.v2.js
assets/js/search/*.js
assets/plotly/demo.html
@@ -10,3 +9,4 @@ lighthouse_results/**
_posts/2015-10-20-math.md
_sass/font-awesome/*.scss
_sass/tabler-icons/*.scss
+_scripts/search.liquid.js
diff --git a/Gemfile b/Gemfile
index 9637fc0..09bfbf4 100644
--- a/Gemfile
+++ b/Gemfile
@@ -18,6 +18,7 @@ group :jekyll_plugins do
gem 'jekyll-toc'
gem 'jekyll-twitter-plugin'
gem 'jemoji'
+ gem 'terser'
gem 'unicode_utils'
gem 'webrick'
end
diff --git a/Gemfile.lock b/Gemfile.lock
index b2814ad..8f4eae1 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,7 +1,7 @@
GEM
remote: https://rubygems.org/
specs:
- activesupport (8.0.0.1)
+ activesupport (8.0.1)
base64
benchmark (>= 0.3)
bigdecimal
@@ -39,7 +39,7 @@ GEM
rexml
csl-styles (1.0.1.11)
csl (~> 1.0)
- css_parser (1.19.1)
+ css_parser (1.21.0)
addressable
cssminify2 (2.0.1)
csv (3.3.0)
@@ -166,7 +166,7 @@ GEM
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
- logger (1.6.2)
+ logger (1.6.3)
loofah (2.23.1)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
@@ -178,17 +178,17 @@ GEM
bigdecimal (~> 3.1)
namae (1.2.0)
racc (~> 1.7)
- nokogiri (1.17.1-aarch64-linux)
+ nokogiri (1.17.2-aarch64-linux)
racc (~> 1.4)
- nokogiri (1.17.1-arm-linux)
+ nokogiri (1.17.2-arm-linux)
racc (~> 1.4)
- nokogiri (1.17.1-arm64-darwin)
+ nokogiri (1.17.2-arm64-darwin)
racc (~> 1.4)
- nokogiri (1.17.1-x86-linux)
+ nokogiri (1.17.2-x86-linux)
racc (~> 1.4)
- nokogiri (1.17.1-x86_64-darwin)
+ nokogiri (1.17.2-x86_64-darwin)
racc (~> 1.4)
- nokogiri (1.17.1-x86_64-linux)
+ nokogiri (1.17.2-x86_64-linux)
racc (~> 1.4)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
@@ -201,30 +201,32 @@ GEM
rexml (3.3.9)
rouge (4.5.1)
safe_yaml (1.0.5)
- sass-embedded (1.82.0-aarch64-linux-gnu)
+ sass-embedded (1.83.0-aarch64-linux-gnu)
google-protobuf (~> 4.28)
- sass-embedded (1.82.0-aarch64-linux-musl)
+ sass-embedded (1.83.0-aarch64-linux-musl)
google-protobuf (~> 4.28)
- sass-embedded (1.82.0-arm-linux-gnueabihf)
+ sass-embedded (1.83.0-arm-linux-gnueabihf)
google-protobuf (~> 4.28)
- sass-embedded (1.82.0-arm-linux-musleabihf)
+ sass-embedded (1.83.0-arm-linux-musleabihf)
google-protobuf (~> 4.28)
- sass-embedded (1.82.0-arm64-darwin)
+ sass-embedded (1.83.0-arm64-darwin)
google-protobuf (~> 4.28)
- sass-embedded (1.82.0-x86-linux-gnu)
+ sass-embedded (1.83.0-x86-linux-gnu)
google-protobuf (~> 4.28)
- sass-embedded (1.82.0-x86-linux-musl)
+ sass-embedded (1.83.0-x86-linux-musl)
google-protobuf (~> 4.28)
- sass-embedded (1.82.0-x86_64-darwin)
+ sass-embedded (1.83.0-x86_64-darwin)
google-protobuf (~> 4.28)
- sass-embedded (1.82.0-x86_64-linux-gnu)
+ sass-embedded (1.83.0-x86_64-linux-gnu)
google-protobuf (~> 4.28)
- sass-embedded (1.82.0-x86_64-linux-musl)
+ sass-embedded (1.83.0-x86_64-linux-musl)
google-protobuf (~> 4.28)
sax-machine (1.3.2)
securerandom (0.4.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
+ terser (1.2.4)
+ execjs (>= 0.3.0, < 3)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uglifier (4.2.1)
@@ -248,6 +250,7 @@ PLATFORMS
x86-linux-gnu
x86-linux-musl
x86_64-darwin
+ x86_64-linux
x86_64-linux-gnu
x86_64-linux-musl
@@ -273,8 +276,9 @@ DEPENDENCIES
jekyll-toc
jekyll-twitter-plugin
jemoji
+ terser
unicode_utils
webrick
BUNDLED WITH
- 2.5.18
+ 2.5.7
diff --git a/_config.yml b/_config.yml
index ec7596d..32eaa03 100644
--- a/_config.yml
+++ b/_config.yml
@@ -181,7 +181,7 @@ kramdown:
start_line: 1
# Includes & excludes
-include: ["_pages"]
+include: ["_pages", "_scripts"]
exclude:
- bin/
- CONTRIBUTING.md
@@ -224,6 +224,7 @@ plugins:
- jekyll-toc
- jekyll-twitter-plugin
- jemoji
+ - terser
# Sitemap settings
defaults:
@@ -240,9 +241,16 @@ sass:
# -----------------------------------------------------------------------------
jekyll-minifier:
- exclude: ["robots.txt", "assets/js/search/*.js", "assets/libs/**/*"]
- uglifier_args:
- harmony: true
+ compress_javascript: false # set to false since we are using terser as the js minifier
+ # exclude: ["robots.txt", "assets/js/search/*.js"]
+
+# -----------------------------------------------------------------------------
+# Terser
+# -----------------------------------------------------------------------------
+
+terser:
+ compress:
+ drop_console: true
# -----------------------------------------------------------------------------
# Jekyll Archives
diff --git a/_includes/distill_scripts.liquid b/_includes/distill_scripts.liquid
new file mode 100644
index 0000000..df4104c
--- /dev/null
+++ b/_includes/distill_scripts.liquid
@@ -0,0 +1,280 @@
+
+
+
+
+
+
+
+{% if page.mermaid and page.mermaid.enabled %}
+
+
+ {% if page.mermaid.zoomable %}
+
+ {% endif %}
+
+{% endif %}
+
+{% if page.code_diff %}
+
+
+
+
+{% endif %}
+
+{% if page.map %}
+
+
+
+{% endif %}
+
+{% if page.chart and page.chart.chartjs %}
+
+
+
+{% endif %}
+
+{% if page.chart and page.chart.echarts %}
+
+
+ {% if site.enable_darkmode %}
+
+ {% endif %}
+
+{% endif %}
+
+{% if page.chart and page.chart.vega_lite %}
+
+
+
+
+
+{% endif %}
+
+{% if page.tikzjax %}
+
+
+{% endif %}
+
+{% if page.typograms %}
+
+
+{% endif %}
+
+{% if site.enable_tooltips %}
+
+
+{% endif %}
+
+{% if site.enable_medium_zoom %}
+
+
+
+{% endif %}
+
+{% if page.toc and page.toc.sidebar %}
+
+
+{% endif %}
+
+{% if page.pretty_table %}
+
+
+
+{% endif %}
+
+
+
+
+
+
+
+
+
+
+
+{% if site.enable_math %}
+
+
+
+
+
+{% endif %}
+
+{% if site.enable_google_analytics %}
+
+
+
+
+{% endif %}
+
+{% if site.enable_cronitor_analytics %}
+
+
+
+{% endif %}
+{% if site.enable_pirsch_analytics %}
+
+{% endif %}
+{% if site.enable_openpanel_analytics %}
+
+
+{% endif %}
+
+{% if site.enable_progressbar %}
+
+
+{% endif %}
+
+{% if page.images %}
+
+ {% if page.images.compare %}
+
+ {% endif %}
+ {% if page.images.lightbox2 %}
+
+ {% endif %}
+ {% if page.images.photoswipe %}
+
+ {% endif %}
+ {% if page.images.slider %}
+
+ {% endif %}
+ {% if page.images.spotlight %}
+
+ {% endif %}
+ {% if page.images.venobox %}
+
+
+ {% endif %}
+{% endif %}
+
+{% if page.tabs %}
+
+
+{% endif %}
+
+{% if site.back_to_top %}
+
+
+
+{% endif %}
+
+{% if site.search_enabled %}
+
+
+
+
+
+
+{% endif %}
diff --git a/_includes/head.liquid b/_includes/head.liquid
index b4d96ef..b869095 100644
--- a/_includes/head.liquid
+++ b/_includes/head.liquid
@@ -10,8 +10,8 @@
crossorigin="anonymous"
>
-
{% if page.pretty_table %}
+
-
{% if page.pseudocode %}
+
{% endif %}
-
{% if page.map %}
+
{% endif %}
-
{% if page.code_diff %}
+
{% if page.images.compare %}
+
{% endif %}
-
{% if page.images.lightbox2 %}
+
{% endif %}
-
{% if page.images.photoswipe %}
+
{% endif %}
-
{% if page.images.slider %}
+
{% endif %}
-
{% if page.images.spotlight %}
+
{% endif %}
-
{% if page.images.venobox %}
+
+
+
+
+
+
+
+{% if site.enable_masonry %}
+
+
+
+
+{% endif %}
+
+{% if page.mermaid and page.mermaid.enabled %}
+
+
+ {% if page.mermaid.zoomable %}
+
+ {% endif %}
+
+{% endif %}
+
+{% if page.code_diff %}
+
+
+
+
+{% endif %}
+
+{% if page.map %}
+
+
+
+{% endif %}
+
+{% if page.chart and page.chart.chartjs %}
+
+
+
+{% endif %}
+
+{% if page.chart and page.chart.echarts %}
+
+
+ {% if site.enable_darkmode %}
+
+ {% endif %}
+
+{% endif %}
+
+{% if page.chart and page.chart.vega_lite %}
+
+
+
+
+
+{% endif %}
+
+{% if page.tikzjax %}
+
+
+{% endif %}
+
+{% if page.typograms %}
+
+
+{% endif %}
+
+{% if site.enable_tooltips %}
+
+
+{% endif %}
+
+{% if site.enable_medium_zoom %}
+
+
+
+{% endif %}
+
+{% if page.toc and page.toc.sidebar %}
+
+
+{% endif %}
+
+{% if page.pretty_table %}
+
+
+
+{% endif %}
+
+
+
+
+
+
+
+
+
+
+{% if site.enable_publication_badges.altmetric %}
+
+{% endif %}
+{% if site.enable_publication_badges.dimensions %}
+
+{% endif %}
+
+{% if site.enable_math %}
+
+
+ {% unless page.pseudocode %}
+
+
+ {% else %}
+
+
+ {% endunless %}
+{% endif %}
+
+{% if site.enable_google_analytics %}
+
+
+
+
+{% endif %}
+
+{% if site.enable_cronitor_analytics %}
+
+
+
+{% endif %}
+{% if site.enable_pirsch_analytics %}
+
+{% endif %}
+{% if site.enable_openpanel_analytics %}
+
+
+{% endif %}
+
+{% if site.enable_progressbar %}
+
+
+{% endif %}
+
+{% if page.images %}
+
+ {% if page.images.compare %}
+
+ {% endif %}
+ {% if page.images.lightbox2 %}
+
+ {% endif %}
+ {% if page.images.photoswipe %}
+
+ {% endif %}
+ {% if page.images.slider %}
+
+ {% endif %}
+ {% if page.images.spotlight %}
+
+ {% endif %}
+ {% if page.images.venobox %}
+
+
+ {% endif %}
+{% endif %}
+
+{% if page.tabs %}
+
+
+{% endif %}
+
+{% if site.back_to_top %}
+
+
+
+{% endif %}
+
+{% if site.search_enabled %}
+
+
+
+
+
+
+{% endif %}
diff --git a/_includes/scripts/analytics.liquid b/_includes/scripts/analytics.liquid
deleted file mode 100644
index 2b9b122..0000000
--- a/_includes/scripts/analytics.liquid
+++ /dev/null
@@ -1,48 +0,0 @@
-{% if site.enable_google_analytics %}
-
-
-
-{% endif %}
-{% if site.enable_cronitor_analytics %}
-
-
-
-{% endif %}
-{% if site.enable_pirsch_analytics %}
-
-{% endif %}
-{% if site.enable_openpanel_analytics %}
-
-
-{% endif %}
diff --git a/_includes/scripts/back_to_top.liquid b/_includes/scripts/back_to_top.liquid
deleted file mode 100644
index 0b74448..0000000
--- a/_includes/scripts/back_to_top.liquid
+++ /dev/null
@@ -1,6 +0,0 @@
-{% if site.back_to_top %}
-
-
-{% endif %}
diff --git a/_includes/scripts/badges.liquid b/_includes/scripts/badges.liquid
deleted file mode 100644
index 7270690..0000000
--- a/_includes/scripts/badges.liquid
+++ /dev/null
@@ -1,6 +0,0 @@
-{% if site.enable_publication_badges.altmetric %}
-
-{% endif %}
-{% if site.enable_publication_badges.dimensions %}
-
-{% endif %}
diff --git a/_includes/scripts/bootstrap.liquid b/_includes/scripts/bootstrap.liquid
deleted file mode 100644
index 2573e77..0000000
--- a/_includes/scripts/bootstrap.liquid
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
diff --git a/_includes/scripts/chartjs.liquid b/_includes/scripts/chartjs.liquid
deleted file mode 100644
index bb21be2..0000000
--- a/_includes/scripts/chartjs.liquid
+++ /dev/null
@@ -1,24 +0,0 @@
-{% if page.chart and page.chart.chartjs %}
-
-
-{% endif %}
diff --git a/_includes/scripts/diff2html.liquid b/_includes/scripts/diff2html.liquid
deleted file mode 100644
index 0c9f0e0..0000000
--- a/_includes/scripts/diff2html.liquid
+++ /dev/null
@@ -1,30 +0,0 @@
-{% if page.code_diff %}
-
-
-
-{% endif %}
diff --git a/_includes/scripts/echarts.liquid b/_includes/scripts/echarts.liquid
deleted file mode 100644
index fce103d..0000000
--- a/_includes/scripts/echarts.liquid
+++ /dev/null
@@ -1,45 +0,0 @@
-{% if page.chart and page.chart.echarts %}
-
- {% if site.enable_darkmode %}
-
- {% endif %}
-
-{% endif %}
diff --git a/_includes/scripts/imageLayouts.liquid b/_includes/scripts/imageLayouts.liquid
deleted file mode 100644
index fb5475e..0000000
--- a/_includes/scripts/imageLayouts.liquid
+++ /dev/null
@@ -1,60 +0,0 @@
-{% if page.images %}
- {% if page.images.compare %}
-
- {% endif %}
- {% if page.images.lightbox2 %}
-
- {% endif %}
- {% if page.images.photoswipe %}
-
- {% endif %}
- {% if page.images.slider %}
-
- {% endif %}
- {% if page.images.spotlight %}
-
- {% endif %}
- {% if page.images.venobox %}
-
-
- {% endif %}
-{% endif %}
diff --git a/_includes/scripts/jekyll_tabs.liquid b/_includes/scripts/jekyll_tabs.liquid
deleted file mode 100644
index 57d08ac..0000000
--- a/_includes/scripts/jekyll_tabs.liquid
+++ /dev/null
@@ -1,3 +0,0 @@
-{% if page.tabs %}
-
-{% endif %}
diff --git a/_includes/scripts/jquery.liquid b/_includes/scripts/jquery.liquid
deleted file mode 100644
index 6663530..0000000
--- a/_includes/scripts/jquery.liquid
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
diff --git a/_includes/scripts/leaflet.liquid b/_includes/scripts/leaflet.liquid
deleted file mode 100644
index 393fdf4..0000000
--- a/_includes/scripts/leaflet.liquid
+++ /dev/null
@@ -1,31 +0,0 @@
-{% if page.map %}
-
-
-{% endif %}
diff --git a/_includes/scripts/masonry.liquid b/_includes/scripts/masonry.liquid
deleted file mode 100644
index ec07f18..0000000
--- a/_includes/scripts/masonry.liquid
+++ /dev/null
@@ -1,16 +0,0 @@
-{% if site.enable_masonry %}
-
-
-
-
-{% endif %}
diff --git a/_includes/scripts/mathjax.liquid b/_includes/scripts/mathjax.liquid
deleted file mode 100644
index df9d5fa..0000000
--- a/_includes/scripts/mathjax.liquid
+++ /dev/null
@@ -1,25 +0,0 @@
-{% if site.enable_math %}
- {% unless page.pseudocode %}
-
-
-
-
- {% endunless %}
-{% endif %}
diff --git a/_includes/scripts/mermaid.liquid b/_includes/scripts/mermaid.liquid
deleted file mode 100644
index 8edab72..0000000
--- a/_includes/scripts/mermaid.liquid
+++ /dev/null
@@ -1,55 +0,0 @@
-{% if page.mermaid and page.mermaid.enabled %}
-
- {% if page.mermaid.zoomable %}
-
- {% endif %}
-
-{% endif %}
diff --git a/_includes/scripts/misc.liquid b/_includes/scripts/misc.liquid
deleted file mode 100644
index 56d68f5..0000000
--- a/_includes/scripts/misc.liquid
+++ /dev/null
@@ -1,43 +0,0 @@
-{% if site.enable_tooltips %}
-
-
-{% endif %}
-{% if site.enable_medium_zoom %}
-
-
-
-{% endif %}
-{% if page.toc and page.toc.sidebar %}
-
-
-{% endif %}
-
-
-{% if page.pretty_table %}
-
-
-{% endif %}
-
-
-
-
-
-
-
-
-
-{% assign site.test-library.url = site.test-library.url | append: 'teste' %}
diff --git a/_includes/scripts/newsletter.liquid b/_includes/scripts/newsletter.liquid
deleted file mode 100644
index 0204ffa..0000000
--- a/_includes/scripts/newsletter.liquid
+++ /dev/null
@@ -1,176 +0,0 @@
-
-
-
-
-
diff --git a/_includes/scripts/progressBar.liquid b/_includes/scripts/progressBar.liquid
deleted file mode 100644
index 08d1915..0000000
--- a/_includes/scripts/progressBar.liquid
+++ /dev/null
@@ -1,78 +0,0 @@
-{% if site.enable_progressbar %}
-
-
-{% endif %}
diff --git a/_includes/scripts/pseudocode.liquid b/_includes/scripts/pseudocode.liquid
deleted file mode 100644
index be942ed..0000000
--- a/_includes/scripts/pseudocode.liquid
+++ /dev/null
@@ -1,52 +0,0 @@
-{% if site.enable_math and page.pseudocode %}
-
-
-
-
-
-{% endif %}
diff --git a/_includes/scripts/search.liquid b/_includes/scripts/search.liquid
deleted file mode 100644
index 4b7308b..0000000
--- a/_includes/scripts/search.liquid
+++ /dev/null
@@ -1,350 +0,0 @@
-{% if site.search_enabled %}
-
-
-
-
-
-{% endif %}
diff --git a/_includes/scripts/tikzjax.liquid b/_includes/scripts/tikzjax.liquid
deleted file mode 100644
index 2bd6e91..0000000
--- a/_includes/scripts/tikzjax.liquid
+++ /dev/null
@@ -1,8 +0,0 @@
-{% if page.tikzjax %}
-
-{% endif %}
diff --git a/_includes/scripts/typograms.liquid b/_includes/scripts/typograms.liquid
deleted file mode 100644
index 0983b2c..0000000
--- a/_includes/scripts/typograms.liquid
+++ /dev/null
@@ -1,23 +0,0 @@
-{% if page.typograms %}
-
-
-
-{% endif %}
diff --git a/_includes/scripts/vega.liquid b/_includes/scripts/vega.liquid
deleted file mode 100644
index 49f1236..0000000
--- a/_includes/scripts/vega.liquid
+++ /dev/null
@@ -1,47 +0,0 @@
-{% if page.chart and page.chart.vega_lite %}
-
-
-
-
-
-{% endif %}
diff --git a/_includes/scripts/wechatModal.liquid b/_includes/scripts/wechatModal.liquid
deleted file mode 100644
index aea2e04..0000000
--- a/_includes/scripts/wechatModal.liquid
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
diff --git a/_includes/social.liquid b/_includes/social.liquid
index 9535c17..308a928 100644
--- a/_includes/social.liquid
+++ b/_includes/social.liquid
@@ -77,7 +77,7 @@
- {% include scripts/wechatModal.liquid %}
+
{% when 'whatsapp_number' %}
{% when 'wikidata_id' %}
diff --git a/_layouts/default.liquid b/_layouts/default.liquid
index 3f4af10..ea10370 100644
--- a/_layouts/default.liquid
+++ b/_layouts/default.liquid
@@ -51,27 +51,6 @@
{% include footer.liquid %}
- {% include scripts/jquery.liquid %}
- {% include scripts/bootstrap.liquid %}
- {% include scripts/masonry.liquid %}
- {% include scripts/mermaid.liquid %}
- {% include scripts/diff2html.liquid %}
- {% include scripts/leaflet.liquid %}
- {% include scripts/chartjs.liquid %}
- {% include scripts/echarts.liquid %}
- {% include scripts/vega.liquid %}
- {% include scripts/tikzjax.liquid %}
- {% include scripts/typograms.liquid %}
- {% include scripts/misc.liquid %}
- {% include scripts/badges.liquid %}
- {% include scripts/mathjax.liquid %}
- {% include scripts/pseudocode.liquid %}
- {% include scripts/analytics.liquid %}
- {% include scripts/progressBar.liquid %}
- {% include scripts/wechatModal.liquid %}
- {% include scripts/imageLayouts.liquid %}
- {% include scripts/jekyll_tabs.liquid %}
- {% include scripts/back_to_top.liquid %}
- {% include scripts/search.liquid %}
+ {% include scripts.liquid %}