From 75c57d1725879ad042e920b3c07c3003f736e3bb Mon Sep 17 00:00:00 2001
From: Cotes Chung <11371340+cotes2020@users.noreply.github.com>
Date: Mon, 1 Jun 2020 22:40:10 +0800
Subject: [PATCH] Simplified the post JS file.
---
_includes/js-selector.html | 6 +-----
assets/js/_utils/{toc.js => toc-filter.js} | 0
assets/js/data/cache-list.js | 1 -
assets/js/post-toc.min.js | 16 ----------------
assets/js/post.min.js | 4 ++++
5 files changed, 5 insertions(+), 22 deletions(-)
rename assets/js/_utils/{toc.js => toc-filter.js} (100%)
delete mode 100644 assets/js/post-toc.min.js
diff --git a/_includes/js-selector.html b/_includes/js-selector.html
index 390ae51..e77930e 100644
--- a/_includes/js-selector.html
+++ b/_includes/js-selector.html
@@ -12,11 +12,7 @@
{% elsif page.layout == 'post' %}
- {% if site.toc and page.toc %}
-
- {% else %}
-
- {% endif %}
+
{% if page.math %}
diff --git a/assets/js/_utils/toc.js b/assets/js/_utils/toc-filter.js
similarity index 100%
rename from assets/js/_utils/toc.js
rename to assets/js/_utils/toc-filter.js
diff --git a/assets/js/data/cache-list.js b/assets/js/data/cache-list.js
index 214362f..418ae12 100644
--- a/assets/js/data/cache-list.js
+++ b/assets/js/data/cache-list.js
@@ -26,7 +26,6 @@ const include = [
'{{ "/assets/js/home.min.js" | relative_url }}',
'{{ "/assets/js/page.min.js" | relative_url }}',
'{{ "/assets/js/post.min.js" | relative_url }}',
- '{{ "/assets/js/post-toc.min.js" | relative_url }}',
/*--- HTML ---*/
diff --git a/assets/js/post-toc.min.js b/assets/js/post-toc.min.js
deleted file mode 100644
index ef9ec29..0000000
--- a/assets/js/post-toc.min.js
+++ /dev/null
@@ -1,16 +0,0 @@
----
-layout: compress
-
-# JS for layout post (with ToC).
-# Chirpy v2.3
-# https://github.com/cotes2020/jekyll-theme-chirpy
-# © 2020 Cotes Chung
-# MIT License
----
-
-
-{% include_relative _home-post.js %}
-
-{% include_relative lib/_bootstrap-toc.min.js %}
-
-{% include_relative _utils/toc.js %}
diff --git a/assets/js/post.min.js b/assets/js/post.min.js
index 4848a59..16d4533 100644
--- a/assets/js/post.min.js
+++ b/assets/js/post.min.js
@@ -9,3 +9,7 @@ layout: compress
---
{% include_relative _home-post.js %}
+
+{% include_relative lib/_bootstrap-toc.min.js %}
+
+{% include_relative _utils/toc-filter.js %}