Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…irpy into bugfix-PR
  • Loading branch information
classicrocker883 committed Jan 27, 2025
2 parents 13afc67 + 0eb7efa commit 2dd0315
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 43 deletions.
3 changes: 2 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ exclude:
- tools
- README.md
- LICENSE
- "*.js"
- purgecss.js
- rollup.config.js
- "package*.json"

jekyll-archives:
Expand Down
10 changes: 0 additions & 10 deletions _includes/no-linenos.html

This file was deleted.

13 changes: 11 additions & 2 deletions _includes/post-description.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,17 @@
{%- if post.description -%}
{{- post.description -}}
{%- else -%}
{%- include no-linenos.html content=post.content -%}
{{- content | markdownify | strip_html -}}
{% comment %}
Remove the line number of the code snippet.
{% endcomment %}
{% assign content = post.content %}

{% if content contains '<td class="rouge-gutter gl"><pre class="lineno">' %}
{% assign content = content | replace: '<td class="rouge-gutter gl"><pre class="lineno">', '<!-- <td class="rouge-gutter gl"><pre class="lineno">'%}
{% assign content = content | replace: '</td><td class="rouge-code">', '</td> --><td class="rouge-code">' %}
{% endif %}

{{- content | markdownify | strip_html | newline_to_br | replace: '<br />', ' ' | strip_newlines -}}
{%- endif -%}
{%- endcapture -%}

Expand Down
2 changes: 1 addition & 1 deletion _includes/search-loader.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h2><a href="{url}">{title}</a></h2>
{tags}
</div>
</header>
<p>{snippet}</p>
<p>{content}</p>
</article>
{% endcapture %}

Expand Down
2 changes: 1 addition & 1 deletion _javascript/modules/components/mermaid.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function refreshTheme(event) {
const mermaidList = document.getElementsByClassName(MERMAID);

[...mermaidList].forEach((elem) => {
const svgCode = elem.previousSibling.children.item(0).innerHTML;
const svgCode = elem.previousSibling.children.item(0).textContent;
elem.textContent = svgCode;
elem.removeAttribute('data-processed');
});
Expand Down
3 changes: 3 additions & 0 deletions _javascript/modules/components/toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ function init() {
mobile.init();
}

const $tocWrapper = document.getElementById('toc-wrapper');
$tocWrapper.classList.remove('invisible');

desktopMode.onchange = refresh;
}

Expand Down
7 changes: 1 addition & 6 deletions _javascript/modules/components/toc/toc-desktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ export class TocDesktop {
}

static init() {
const $tocWrapper = document.getElementById('toc-wrapper');

if ($tocWrapper) {
tocbot.init(this.options);
$tocWrapper.classList.remove('invisible');
}
tocbot.init(this.options);
}
}
2 changes: 1 addition & 1 deletion _posts/2019-08-08-write-a-new-post.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ toc: false

## Comments

The global switch of comments is defined by variable `comments.active` in the file `_config.yml`{: .filepath}. After selecting a comment system for this variable, comments will be turned on for all posts.
The global setting for comments is defined by the `comments.provider` option in the `_config.yml`{: .filepath} file. Once a comment system is selected for this variable, comments will be enabled for all posts.

If you want to close the comment for a specific post, add the following to the **Front Matter** of the post:

Expand Down
23 changes: 8 additions & 15 deletions _sass/pages/_post.scss
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,11 @@ header {
@-webkit-keyframes fade-up {
from {
opacity: 0;
position: relative;
top: 2rem;
margin-top: 4rem;
}

to {
opacity: 1;
position: relative;
top: 0;
}
}

Expand All @@ -247,6 +244,7 @@ header {
%top-cover {
content: '';
display: block;
position: -webkit-sticky;
position: sticky;
top: 0;
width: 100%;
Expand All @@ -257,30 +255,25 @@ header {
#toc-wrapper {
top: 0;
transition: top 0.2s ease-in-out;
-webkit-animation: fade-up 0.8s;
animation: fade-up 0.8s;
overflow-y: auto;
max-height: 100vh;
scrollbar-width: none;
margin-top: 2rem;

&:not(.invisible) {
-webkit-animation: fade-up 0.8s;
animation: fade-up 0.8s;
}

ul {
list-style: none;
font-size: 0.85rem;
line-height: 1.25;
padding-left: 0;

li {
&:not(:last-child) {
margin: 0.4rem 0;
}

&:first-child {
margin-top: 0;
}

a {
padding: 0.2rem 0 0.2rem 1.25rem;
padding: 0.4rem 0 0.4rem 1.25rem;
}
}

Expand Down
8 changes: 4 additions & 4 deletions assets/js/data/search.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ swcache: true

[
{% for post in site.posts %}
{%- capture description -%}
{% include post-description.html %}
{%- endcapture -%}
{
"title": {{ post.title | jsonify }},
"url": {{ post.url | relative_url | jsonify }},
"categories": {{ post.categories | join: ', ' | jsonify }},
"tags": {{ post.tags | join: ', ' | jsonify }},
"date": "{{ post.date }}",
{% include no-linenos.html content=post.content %}
{% assign _content = content | strip_html | strip_newlines %}
"snippet": {{ _content | truncate: 200 | jsonify }},
"content": {{ _content | jsonify }}
"content": "{{ description }}"
}{% unless forloop.last %},{% endunless %}
{% endfor %}
]
21 changes: 21 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## [7.2.4](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v7.2.3...v7.2.4) (2024-12-21)

### Bug Fixes

* toc not visible when switching from mobile to desktop mode ([#2139](https://github.com/cotes2020/jekyll-theme-chirpy/issues/2139)) ([32051da](https://github.com/cotes2020/jekyll-theme-chirpy/commit/32051dad03cb8f60fa4206969377b9674f9a3f0c))
* **ui:** left borderline of TOC is notched ([#2140](https://github.com/cotes2020/jekyll-theme-chirpy/issues/2140)) ([8a4d0bc](https://github.com/cotes2020/jekyll-theme-chirpy/commit/8a4d0bc4ee9e142a11401cad80bc9605878f121d))

## [7.2.3](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v7.2.2...v7.2.3) (2024-12-15)

### Bug Fixes

* refreshing mermaid theme may fail ([#2113](https://github.com/cotes2020/jekyll-theme-chirpy/issues/2113)) ([2f00d41](https://github.com/cotes2020/jekyll-theme-chirpy/commit/2f00d41861f1b06c2ff7fa4e67e14e647c3c34b0))
* **ui:** gap between TOC entries is inconsistent ([#2119](https://github.com/cotes2020/jekyll-theme-chirpy/issues/2119)) ([1b4e318](https://github.com/cotes2020/jekyll-theme-chirpy/commit/1b4e318dc1cd57da812e11bf69ebb06083c213fc))
* **ui:** slow script loading hides TOC fade-up effect in desktop ([#2120](https://github.com/cotes2020/jekyll-theme-chirpy/issues/2120)) ([e0c3faf](https://github.com/cotes2020/jekyll-theme-chirpy/commit/e0c3fafa470eb12bd04ffdf198018bc28b6de20d))

## [7.2.2](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v7.2.1...v7.2.2) (2024-12-06)

### Bug Fixes

* js files in subdirectories are excluded from the site output ([#2101](https://github.com/cotes2020/jekyll-theme-chirpy/issues/2101)) ([f55cc31](https://github.com/cotes2020/jekyll-theme-chirpy/commit/f55cc31dbd0e7455328c80c7ef38186ad8e54099))

## [7.2.1](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v7.2.0...v7.2.1) (2024-12-05)

### Bug Fixes
Expand Down
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 = "7.2.1"
spec.version = "7.2.4"
spec.authors = ["Cotes Chung"]
spec.email = ["[email protected]"]

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": "7.2.1",
"version": "7.2.4",
"description": "A minimal, responsive, and feature-rich Jekyll theme for technical writing.",
"repository": {
"type": "git",
Expand Down

0 comments on commit 2dd0315

Please sign in to comment.