diff --git a/CHANGELOG.md b/CHANGELOG.md index ea9759a..c6b54d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,17 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. -### [5.3.1](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v5.3.0...v5.3.1) (2022-10-25) +## [5.3.2](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v5.3.1...v5.3.2) (2022-11-22) + + +### Bug Fixes + +* `mermaid` occasionally fails to initialize ([#536](https://github.com/cotes2020/jekyll-theme-chirpy/issues/536)) ([48f14e3](https://github.com/cotes2020/jekyll-theme-chirpy/commit/48f14e39ac81bbfb3b9913ea3ee789d775b2d1ae)) +* **comment:** disqus doesn't follow theme mode switching ([b0d5956](https://github.com/cotes2020/jekyll-theme-chirpy/commit/b0d5956f5a0ed894984d6b1754efeba04d8bc966)) +* restore full-text search ([#741](https://github.com/cotes2020/jekyll-theme-chirpy/issues/741)) ([6774e0e](https://github.com/cotes2020/jekyll-theme-chirpy/commit/6774e0e1fb37cf467b14be481347412713763f05)) +* the image URL in the SEO-related tags is incomplete ([#754](https://github.com/cotes2020/jekyll-theme-chirpy/issues/754)) ([f6e9a3f](https://github.com/cotes2020/jekyll-theme-chirpy/commit/f6e9a3fccf7ab34db71f8aefaf86fdcc05861076)) + +## [5.3.1](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v5.3.0...v5.3.1) (2022-10-25) ### Bug Fixes diff --git a/README.md b/README.md index 443f4b6..33f312b 100644 --- a/README.md +++ b/README.md @@ -102,4 +102,4 @@ This work is published under [MIT](https://github.com/cotes2020/jekyll-theme-chi [jb]: https://www.jetbrains.com/?from=jekyll-theme-chirpy -[cn-donation]: https://cotes2020.github.io/sponsor/ +[cn-donation]: https://sponsor.cotes.page/ diff --git a/_config.yml b/_config.yml index 391f5dc..a43d2a5 100644 --- a/_config.yml +++ b/_config.yml @@ -78,7 +78,7 @@ theme_mode: # [light|dark] # will be added to all image (site avatar & posts' images) paths starting with '/' # # e.g. 'https://cdn.com' -img_cdn: 'https://raw.githubusercontent.com/cotes2020/chirpy-images/main' +img_cdn: 'https://demo-img.cotes.page' # the avatar on sidebar, support local or CORS resources avatar: '/commons/avatar.jpg' diff --git a/_data/assets/cross_origin.yml b/_data/assets/cross_origin.yml index 317354a..a7d024e 100644 --- a/_data/assets/cross_origin.yml +++ b/_data/assets/cross_origin.yml @@ -27,7 +27,7 @@ bootstrap-toc: js: https://cdn.jsdelivr.net/gh/afeld/bootstrap-toc@1.0.1/dist/bootstrap-toc.min.js fontawesome: - css: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.11.2/css/all.min.css + css: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/css/all.min.css search: js: https://cdn.jsdelivr.net/npm/simple-jekyll-search@1.10.0/dest/simple-jekyll-search.min.js diff --git a/_data/assets/self_host.yml b/_data/assets/self_host.yml index 4649b56..b6410a4 100644 --- a/_data/assets/self_host.yml +++ b/_data/assets/self_host.yml @@ -16,7 +16,7 @@ bootstrap-toc: js: /assets/lib/bootstrap-toc-1.0.1/bootstrap-toc.min.js fontawesome: - css: /assets/lib/fontawesome-free-5.15.4/css/all.min.css + css: /assets/lib/fontawesome-free-6.2.1/css/all.min.css search: js: /assets/lib/simple-jekyll-search-1.10.0/simple-jekyll-search.min.js diff --git a/_includes/comments/disqus.html b/_includes/comments/disqus.html index 8b4e633..6174d31 100644 --- a/_includes/comments/disqus.html +++ b/_includes/comments/disqus.html @@ -15,7 +15,6 @@ }; /* Lazy loading */ - var disqus_observer = new IntersectionObserver(function (entries) { if(entries[0].isIntersecting) { (function () { @@ -32,23 +31,24 @@ disqus_observer.observe(document.querySelector('#disqus_thread')); /* Auto switch theme */ - function reloadDisqus() { - /* Disqus hasn't been loaded */ - if (typeof DISQUS === "undefined") { - return; - } + if (event.source === window && event.data && + event.data.direction === ModeToggle.ID) { + /* Disqus hasn't been loaded */ + if (typeof DISQUS === "undefined") { + return; + } - if (document.readyState == 'complete') { - DISQUS.reset({ reload: true, config: disqus_config }); + if (document.readyState == 'complete') { + DISQUS.reset({ reload: true, config: disqus_config }); + } } } const modeToggle = document.querySelector(".mode-toggle"); if (typeof modeToggle !== "undefined") { - /* modeToggle.addEventListener('click', reloadDisqus); // not pretty for 'color-scheme' */ - window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', reloadDisqus); + window.addEventListener("message", reloadDisqus); } diff --git a/_includes/head.html b/_includes/head.html index 0947587..03ab48f 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -22,23 +22,22 @@ {% seo title=false %} {% endcapture %} - {% if site.img_cdn and seo_tags contains 'og:image' %} - {% assign properties = 'og:image,twitter:image' | split: ',' %} + {% if page.image %} + {% assign img = page.image.path | default: page.image %} + {% assign img_path = page.img_path | append: '/' | append: img | replace: '//', '/' %} + {% capture target %}"{{ img | absolute_url }}"{% endcapture %} - {% for prop in properties %} - {% if site.img_cdn contains '//' %} - - {% capture target %} + {%- capture replacement -%} + "{{ site.img_cdn | append: '/' | append: img_path | replace: '//', '/' | absolute_url }}" + {%- endcapture -%} + {% endif %} - {% assign seo_tags = seo_tags | replace: target, replacement %} - - {% endfor %} + {% assign seo_tags = seo_tags | replace: target, replacement %} {% endif %} {{ seo_tags }} diff --git a/_includes/mermaid.html b/_includes/mermaid.html index e89a12e..2ec8029 100644 --- a/_includes/mermaid.html +++ b/_includes/mermaid.html @@ -5,10 +5,11 @@ diff --git a/_includes/refactor-content.html b/_includes/refactor-content.html index 89b9908..6535e91 100644 --- a/_includes/refactor-content.html +++ b/_includes/refactor-content.html @@ -107,13 +107,7 @@ {% if page.img_path %} - {% assign _path = page.img_path %} - {% assign last_char = _path | slice: -1 %} - - {% unless last_char == '/' %} - {% assign _path = _path | append: '/' %} - {% endunless %} - + {% assign _path = page.img_path | append: '/' | replace: '//', '/' %} {% assign _src_prefix = _src_prefix | append: _path %} {% endif %} diff --git a/_javascript/copyright b/_javascript/copyright index c8063f6..a45813d 100644 --- a/_javascript/copyright +++ b/_javascript/copyright @@ -1,5 +1,5 @@ /*! - * Chirpy v5.3.1 (https://github.com/cotes2020/jekyll-theme-chirpy/) + * Chirpy v5.3.2 (https://github.com/cotes2020/jekyll-theme-chirpy/) * © 2019 Cotes Chung * MIT Licensed */ diff --git a/_layouts/post.html b/_layouts/post.html index 44de48a..18b0503 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -26,13 +26,13 @@ tail_includes: {% endif %} - {% if page.image.path %} + {% if page.image %} {% capture bg %} {% unless page.image.no_bg %}{{ 'bg' }}{% endunless %} {% endcapture %}