Skip to content

Commit

Permalink
Merge branch 'master' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
cotes2020 committed Nov 22, 2022
2 parents c0e3e61 + fe2a3cd commit 5b5a386
Show file tree
Hide file tree
Showing 27 changed files with 108 additions and 81 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ This work is published under [MIT](https://github.com/cotes2020/jekyll-theme-chi
<!-- ReadMe links -->

[jb]: https://www.jetbrains.com/?from=jekyll-theme-chirpy
[cn-donation]: https://cotes2020.github.io/sponsor/
[cn-donation]: https://sponsor.cotes.page/
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion _data/assets/cross_origin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion _data/assets/self_host.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 11 additions & 11 deletions _includes/comments/disqus.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
};

/* Lazy loading */

var disqus_observer = new IntersectionObserver(function (entries) {
if(entries[0].isIntersecting) {
(function () {
Expand All @@ -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 (document.readyState == 'complete') {
DISQUS.reset({ reload: true, config: disqus_config });
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 });
}
}
}

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);
}

</script>
31 changes: 15 additions & 16 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -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: ',' %}

{% for prop in properties %}
{% if site.img_cdn contains '//' %}
<!-- `site.img_cdn` is a cross-origin URL -->
{% capture target %}<meta property="{{ prop }}" content="{{ site.url }}{% endcapture %}
{% capture replacement %}<meta property="{{ prop }}" content="{{ site.img_cdn }}{% endcapture %}
{% else %}
<!-- `site.img_cdn` is a local file path -->
{% capture target %}<meta property="{{ prop }}" content="{{ site.url }}{{ site.baseurl }}{% endcapture %}
{% assign replacement = target | append: site.img_cdn %}
{% endif %}
{% assign seo_tags = seo_tags | replace: target, replacement %}
{% 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 %}

{% if site.img_cdn contains '//' %}
<!-- it's a cross-origin URL -->
{% capture replacement %}"{{ site.img_cdn }}{{ img_path }}"{% endcapture %}
{% else %}
<!-- it's a local file path -->
{%- capture replacement -%}
"{{ site.img_cdn | append: '/' | append: img_path | replace: '//', '/' | absolute_url }}"
{%- endcapture -%}
{% endif %}

{% endfor %}
{% assign seo_tags = seo_tags | replace: target, replacement %}
{% endif %}

{{ seo_tags }}
Expand Down
22 changes: 12 additions & 10 deletions _includes/mermaid.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@
<script src="{{ site.data.assets[origin].mermaid.js | relative_url }}"></script>

<script>
$(function() {
(function () {

function updateMermaid(event) {
if (event.source === window && event.data &&
event.data.direction === ModeToggle.ID) {
event.data.direction === ModeToggle.ID) {

const mode = event.data.message;

if (typeof mermaid === "undefined") {
return;
}

let expectedTheme = (mode === ModeToggle.DARK_MODE? "dark" : "default");
let config = { theme: expectedTheme };
let expectedTheme = (mode === ModeToggle.DARK_MODE ? "dark" : "default");
let config = {theme: expectedTheme};

/* Re-render the SVG › <https://github.com/mermaid-js/mermaid/issues/311#issuecomment-332557344> */
$(".mermaid").each(function() {
$(".mermaid").each(function () {
let svgCode = $(this).prev().children().html();
$(this).removeAttr("data-processed");
$(this).html(svgCode);
Expand All @@ -35,23 +36,24 @@

if ($("html[data-mode=dark]").length > 0
|| ($("html[data-mode]").length == 0
&& window.matchMedia("(prefers-color-scheme: dark)").matches ) ) {
&& window.matchMedia("(prefers-color-scheme: dark)").matches)) {
initTheme = "dark";
}

let mermaidConf = {
theme: initTheme /* <default|dark|forest|neutral> */
};

/* Markdown converts to HTML */
$("pre").has("code.language-mermaid").each(function() {
/* Create mermaid tag */
$("pre").has("code.language-mermaid").each(function () {
let svgCode = $(this).children().html();
$(this).addClass("unloaded");
$(this).after(`<div class=\"mermaid\">${svgCode}</div>`);
$(this).after(`<pre class=\"mermaid\">${svgCode}</pre>`);
});

mermaid.initialize(mermaidConf);

window.addEventListener("message", updateMermaid);
});
})();

</script>
8 changes: 1 addition & 7 deletions _includes/refactor-content.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,7 @@

<!-- Add image path -->
{% 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 %}

Expand Down
2 changes: 1 addition & 1 deletion _javascript/copyright
Original file line number Diff line number Diff line change
@@ -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
*/
4 changes: 2 additions & 2 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ <h1 data-toc-skip>{{ page.title }}</h1>
</span>
{% endif %}

{% if page.image.path %}
{% if page.image %}
{% capture bg %}
{% unless page.image.no_bg %}{{ 'bg' }}{% endunless %}
{% endcapture %}

<div class="mt-3 mb-3">
<img src="{{ page.image.path }}" class="preview-img {{ bg | strip }}"
<img src="{{ page.image.path | default: page.image }}" class="preview-img {{ bg | strip }}"
alt="{{ page.image.alt | default: "Preview Image" }}"

{% if page.image.width %}
Expand Down
8 changes: 6 additions & 2 deletions _posts/2019-08-08-write-a-new-post.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ If you want to add an image to the top of the post contents, specify the attribu
```yaml
---
image:
path: /path/to/image/file
path: /path/to/image
width: 1000 # in pixels
height: 400 # in pixels
alt: image alternative text
Expand All @@ -254,7 +254,11 @@ Except for `alt`, all other options are necessary, especially the `width` and `h

Starting from _Chirpy v5.0.0_, the attributes `height` and `width` can be abbreviated: `height` → `h`, `width` → `w`. In addition, the [`img_path`](#image-path) can also be passed to the preview image, that is, when it has been set, the attribute `path` only needs the image file name.

Starting from _Chirpy v5.2.0_, the property for the preview image is changed to `image.path`. If upgrading the theme from a prior version, you will have to update posts' metadata to use new image property.
For simple use, you can also just use `image` to define the path.

```yml
image: /path/to/image
```

## Pinned Posts

Expand Down
6 changes: 6 additions & 0 deletions _posts/2019-08-09-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ Now you can choose ONE of the following methods to deploy your Jekyll site.

Ensure your Jekyll site has the file `.github/workflows/pages-deploy.yml`{: .filepath}. Otherwise, create a new one and fill in the contents of the [sample file][workflow], and the value of the `on.push.branches` should be the same as your repo's default branch name. And then rename your repository to `<GH_USERNAME>.github.io` on GitHub.

Furthermore, if you have committed `Gemfile.lock`{: .filepath} to the repository and your local machine is not Linux, go the the root directory of your site and update the platform list:

```console
$ bundle lock --add-platform x86_64-linux
```

Now publish your Jekyll site:

1. Browse to your repository on GitHub. Select the tab _Settings_, then click _Pages_ in the left navigation bar. Then, in the **Source** section (under _Build and deployment_), select [**GitHub Actions**][pages-workflow-src] from the dropdown menu.
Expand Down
31 changes: 17 additions & 14 deletions _sass/addon/commons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -461,21 +461,24 @@ img[data-src] {
}
}

> ol,
> ul {
-webkit-padding-start: 1.75rem;
padding-inline-start: 1.75rem;

li {
margin: 0.25rem 0;
padding-left: 0.25rem;
}
ol,
ul {
&:not([class]),
&.task-list {
-webkit-padding-start: 1.75rem;
padding-inline-start: 1.75rem;

li {
margin: 0.25rem 0;
padding-left: 0.25rem;
}

ol,
ul {
-webkit-padding-start: 1rem;
padding-inline-start: 1rem;
margin: 0.5rem 0;
ol,
ul {
-webkit-padding-start: 1.25rem;
padding-inline-start: 1.25rem;
margin: 0.5rem 0;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion _sass/jekyll-theme-chirpy.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* The styles for Jekyll theme Chirpy
*
* 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
*/
Expand Down
4 changes: 3 additions & 1 deletion assets/js/data/search.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ swcache: true
"tags": {{ post.tags | join: ', ' | jsonify }},
"date": "{{ post.date }}",
{% include no-linenos.html content=post.content %}
"snippet": {{ content | strip_html | strip_newlines | truncate: 200 | jsonify }}
{% assign _content = content | strip_html | strip_newlines %}
"snippet": {{ _content | truncate: 200 | jsonify }},
"content": {{ _content | jsonify }}
}{% unless forloop.last %},{% endunless %}
{% endfor %}
]
2 changes: 1 addition & 1 deletion assets/js/dist/categories.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/js/dist/commons.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/js/dist/home.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/js/dist/misc.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/js/dist/page.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/js/dist/post.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/js/dist/pvreport.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/lib
Submodule lib updated 26 files
+0 −5 fontawesome-free-5.15.4/css/all.min.css
+ fontawesome-free-5.15.4/webfonts/fa-brands-400.eot
+0 −3,717 fontawesome-free-5.15.4/webfonts/fa-brands-400.svg
+ fontawesome-free-5.15.4/webfonts/fa-brands-400.ttf
+ fontawesome-free-5.15.4/webfonts/fa-brands-400.woff
+ fontawesome-free-5.15.4/webfonts/fa-brands-400.woff2
+ fontawesome-free-5.15.4/webfonts/fa-regular-400.eot
+0 −801 fontawesome-free-5.15.4/webfonts/fa-regular-400.svg
+ fontawesome-free-5.15.4/webfonts/fa-regular-400.ttf
+ fontawesome-free-5.15.4/webfonts/fa-regular-400.woff
+ fontawesome-free-5.15.4/webfonts/fa-regular-400.woff2
+ fontawesome-free-5.15.4/webfonts/fa-solid-900.eot
+0 −5,034 fontawesome-free-5.15.4/webfonts/fa-solid-900.svg
+ fontawesome-free-5.15.4/webfonts/fa-solid-900.ttf
+ fontawesome-free-5.15.4/webfonts/fa-solid-900.woff
+ fontawesome-free-5.15.4/webfonts/fa-solid-900.woff2
+165 −0 fontawesome-free-6.2.1/LICENSE.txt
+6 −0 fontawesome-free-6.2.1/css/all.min.css
+ fontawesome-free-6.2.1/webfonts/fa-brands-400.ttf
+ fontawesome-free-6.2.1/webfonts/fa-brands-400.woff2
+ fontawesome-free-6.2.1/webfonts/fa-regular-400.ttf
+ fontawesome-free-6.2.1/webfonts/fa-regular-400.woff2
+ fontawesome-free-6.2.1/webfonts/fa-solid-900.ttf
+ fontawesome-free-6.2.1/webfonts/fa-solid-900.woff2
+ fontawesome-free-6.2.1/webfonts/fa-v4compatibility.ttf
+ fontawesome-free-6.2.1/webfonts/fa-v4compatibility.woff2
2 changes: 1 addition & 1 deletion jekyll-theme-chirpy.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |spec|
spec.name = "jekyll-theme-chirpy"
spec.version = "5.3.1"
spec.version = "5.3.2"
spec.authors = ["Cotes Chung"]
spec.email = ["cotes.chung@gmail.com"]

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jekyll-theme-chirpy",
"version": "5.3.1",
"version": "5.3.2",
"description": "A minimal, responsive, and powerful Jekyll theme for presenting professional writing.",
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit 5b5a386

Please sign in to comment.