Skip to content

Commit d9e1d84

Browse files
committed
refactor(deps): upgrade bootstrap from v4.6 to v5.2
- update class name of the spacing, font style, cards and toasts - update attribute names & tooltip usage - remove custom smooth scroll - syntax colors
1 parent 3210c59 commit d9e1d84

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+170
-304
lines changed

_data/assets/cross_origin.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ jquery:
1919
js: https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js
2020

2121
bootstrap:
22-
css: https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css
23-
js: https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js
22+
css: https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css
23+
js: https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js
2424

2525
toc:
2626
css: https://cdn.jsdelivr.net/npm/[email protected]/dist/tocbot.min.css

_includes/datetime.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
data-ts="{{ include.date | date: '%s' }}"
1313
data-df="{{ df_dayjs }}"
1414
{% if include.tooltip %}
15-
data-toggle="tooltip" data-placement="bottom"
15+
data-bs-toggle="tooltip" data-bs-placement="bottom"
1616
{% endif %}
1717
>
1818
{{ include.date | date: df_strftime }}

_includes/footer.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<!-- The Footer -->
22

33
<footer>
4-
<div class="container pl-lg-4 pr-lg-4">
5-
<div class="d-flex justify-content-center align-items-center text-muted ml-md-3 mr-md-3">
4+
<div class="container px-lg-4">
5+
<div class="d-flex justify-content-center align-items-center text-muted mx-md-3">
66
<p>
77
{%- capture _platform -%}
88
<a href="https://jekyllrb.com" target="_blank" rel="noopener">Jekyll</a>
@@ -21,8 +21,8 @@
2121
<a href="{{ site.social.links[0] }}">{{ site.social.name }}</a>.
2222
{% if site.data.locales[include.lang].copyright.brief %}
2323
<span
24-
data-toggle="tooltip"
25-
data-placement="top"
24+
data-bs-toggle="tooltip"
25+
data-bs-placement="top"
2626
title="{{ site.data.locales[include.lang].copyright.verbose }}"
2727
>
2828
{{- site.data.locales[include.lang].copyright.brief -}}

_includes/post-paginator.html

+13-12
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
<!--
2-
The paginator for post list on HomgPage.
3-
-->
1+
<!-- The paginator for post list on HomgPage. -->
42

5-
<ul class="pagination align-items-center mt-4 pl-lg-2">
3+
<ul class="pagination align-items-center mt-4 ps-lg-2">
64
<!-- left arrow -->
75
{% if paginator.previous_page %}
86
{% assign prev_url = paginator.previous_page_path | relative_url %}
97
{% else %}
10-
{% assign prev_url = "#" %}
8+
{% assign prev_url = '#' %}
119
{% endif %}
1210

1311
<li class="page-item {% unless paginator.previous_page %}disabled{% endunless %}">
@@ -21,7 +19,6 @@
2119
{% assign right_ellipsis = false %}
2220

2321
{% for i in (1..paginator.total_pages) %}
24-
2522
{% assign pre = paginator.page | minus: 1 %}
2623
{% assign next = paginator.page | plus: 1 %}
2724
{% assign pre_less = pre | minus: 1 %}
@@ -37,7 +34,7 @@
3734
{% assign show = true %}
3835
{% endif %}
3936
{% else %}
40-
{% if i == 1 or i == paginator.total_pages%}
37+
{% if i == 1 or i == paginator.total_pages %}
4138
{% assign show = true %}
4239
{% elsif i >= pre and i <= next %}
4340
{% assign show = true %}
@@ -47,7 +44,12 @@
4744
{% if show %}
4845
<!-- show number -->
4946
<li class="page-item {% if i == paginator.page %} active{% endif %}">
50-
<a class="page-link btn-box-shadow" href="{% if i > 1 %}{{ site.paginate_path | replace: ':num', i | relative_url }}{% else %}{{ '/' | relative_url }}{% endif %}">{{ i }}</a>
47+
<a
48+
class="page-link btn-box-shadow"
49+
href="{% if i > 1 %}{{ site.paginate_path | replace: ':num', i | relative_url }}{% else %}{{ '/' | relative_url }}{% endif %}"
50+
>
51+
{{- i -}}
52+
</a>
5153
</li>
5254
{% else %}
5355
<!-- hide number -->
@@ -63,7 +65,6 @@
6365
{% assign right_ellipsis = true %}
6466
{% endif %}
6567
{% endif %}
66-
6768
{% endfor %}
6869

6970
<!-- mobile pagination -->
@@ -76,13 +77,13 @@
7677
{% if paginator.next_page_path %}
7778
{% assign next_url = paginator.next_page_path | relative_url %}
7879
{% else %}
79-
{% assign next_url = "#" %}
80+
{% assign next_url = '#' %}
8081
{% endif %}
8182

8283
<li class="page-item {% unless paginator.next_page_path %}disabled{% endunless %}">
8384
<a class="page-link btn-box-shadow" href="{{ next_url }}" aria-label="next-page">
8485
<i class="fas fa-angle-right"></i>
8586
</a>
8687
</li>
87-
88-
</ul> <!-- .pagination -->
88+
</ul>
89+
<!-- .pagination -->

_includes/post-sharing.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- Post sharing snippet -->
22

33
<div class="share-wrapper">
4-
<span class="share-label text-muted mr-1">{{ site.data.locales[include.lang].post.share }}</span>
4+
<span class="share-label text-muted me-1">{{ site.data.locales[include.lang].post.share }}</span>
55
<span class="share-icons">
66
{% capture title %}{{ page.title }} - {{ site.title }}{% endcapture %}
77
{% assign title = title | uri_escape %}
@@ -11,8 +11,8 @@
1111
{% assign link = share.link | replace: 'TITLE', title | replace: 'URL', url %}
1212
<a
1313
href="{{ link }}"
14-
data-toggle="tooltip"
15-
data-placement="top"
14+
data-bs-toggle="tooltip"
15+
data-bs-placement="top"
1616
title="{{ share.type }}"
1717
target="_blank"
1818
rel="noopener"
@@ -25,8 +25,8 @@
2525
<i
2626
id="copy-link"
2727
class="fa-fw fas fa-link small"
28-
data-toggle="tooltip"
29-
data-placement="top"
28+
data-bs-toggle="tooltip"
29+
data-bs-placement="top"
3030
title="{{ site.data.locales[include.lang].post.button.share_link.title }}"
3131
data-title-succeed="{{ site.data.locales[include.lang].post.button.share_link.succeed }}"
3232
>

_includes/read-time.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
<!-- return element -->
2121
<span
2222
class="readtime"
23-
data-toggle="tooltip"
24-
data-placement="bottom"
23+
data-bs-toggle="tooltip"
24+
data-bs-placement="bottom"
2525
title="{{ words }} {{ site.data.locales[include.lang].post.words }}"
2626
>
2727
<em>

_includes/refactor-content.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@
271271

272272
{% assign left = snippet | split: mark_end | first %}
273273
{% assign right = snippet | slice: left.size, snippet.size %}
274-
{% assign left = left | replace_first: '">', '"><span class="mr-2">' | append: '</span>' %}
274+
{% assign left = left | replace_first: '">', '"><span class="me-2">' | append: '</span>' %}
275275

276276
{% assign _new_content = _new_content | append: mark_start
277277
| append: left | append: anchor | append: right

_includes/related-posts.html

+15-16
Original file line numberDiff line numberDiff line change
@@ -75,28 +75,27 @@
7575

7676
{% if index_list.size > 0 %}
7777
<div id="related-posts" class="mb-2 mb-sm-4">
78-
<h3
79-
class="pt-2 mb-4 ml-1"
80-
data-toc-skip
81-
>
78+
<h3 class="pt-2 mb-4 ms-1" data-toc-skip>
8279
{{ site.data.locales[include.lang].post.relate_posts }}
8380
</h3>
84-
<div class="card-deck mb-4">
81+
<div class="row row-cols-1 row-cols-md-2 row-cols-xl-3 g-4 mb-4">
8582
{% for entry in index_list %}
8683
{% assign index = entry | plus: 0 %}
8784
{% assign post = site.posts[index] %}
88-
<a href="{{ post.url | relative_url }}" class="card post-preview">
89-
<div class="card-body">
90-
{% include datetime.html date=post.date class="small" lang=include.lang %}
91-
<h3 class="pt-0 mt-2 mb-3" data-toc-skip>{{ post.title }}</h3>
92-
<div class="text-muted small">
93-
<p>
94-
{% include no-linenos.html content=post.content %}
95-
{{ content | markdownify | strip_html | truncate: 200 | escape }}
96-
</p>
85+
<div class="col">
86+
<a href="{{ post.url | relative_url }}" class="card post-preview h-100">
87+
<div class="card-body">
88+
{% include datetime.html date=post.date class="small" lang=include.lang %}
89+
<h3 class="pt-0 my-2" data-toc-skip>{{ post.title }}</h3>
90+
<div class="text-muted small">
91+
<p>
92+
{% include no-linenos.html content=post.content %}
93+
{{ content | markdownify | strip_html | truncate: 200 | escape }}
94+
</p>
95+
</div>
9796
</div>
98-
</div>
99-
</a>
97+
</a>
98+
</div>
10099
{% endfor %}
101100
</div>
102101
<!-- .card-deck -->

_includes/search-loader.html

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
-->
55

66
{% capture result_elem %}
7-
<div class="pl-1 pr-1 pl-sm-2 pr-sm-2 pl-lg-4 pr-lg-4 pl-xl-0 pr-xl-0">
7+
<div class="px-1 px-sm-2 px-lg-4 px-xl-0">
88
<a href="{url}">{title}</a>
99
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
1010
{categories}
@@ -19,6 +19,7 @@
1919
<script src="{{ site.data.assets[origin].search.js | relative_url }}"></script>
2020

2121
<script>
22+
2223
SimpleJekyllSearch({
2324
searchInput: document.getElementById('search-input'),
2425
resultsContainer: document.getElementById('search-results'),
@@ -30,7 +31,7 @@
3031
if (value === '') {
3132
return `${value}`;
3233
} else {
33-
return `<div class="mr-sm-4"><i class="far fa-folder fa-fw"></i>${value}</div>`;
34+
return `<div class="me-sm-4"><i class="far fa-folder fa-fw"></i>${value}</div>`;
3435
}
3536
}
3637

@@ -43,4 +44,5 @@
4344
}
4445
}
4546
});
47+
4648
</script>

_includes/search-results.html

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
<!--
2-
The Search results
3-
-->
1+
<!-- The Search results -->
2+
43
<div id="search-result-wrapper" class="d-flex justify-content-center unloaded">
5-
<div class="col-12 col-sm-11 post-content">
4+
<div class="col-11 post-content">
65
<div id="search-hints">
76
{% include trending-tags.html %}
87
</div>

_includes/sidebar.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
<div class="site-title">
2121
<a href="{{ '/' | relative_url }}">{{ site.title }}</a>
2222
</div>
23-
<div class="site-subtitle font-italic">{{ site.tagline }}</div>
23+
<div class="site-subtitle fst-italic">{{ site.tagline }}</div>
2424
</div>
2525
<!-- .profile-wrapper -->
2626

27-
<ul class="flex-grow-1 w-100 pl-0">
27+
<ul class="nav flex-column flex-grow-1 w-100 ps-0">
2828
<!-- home -->
2929
<li class="nav-item{% if page.layout == 'home' %}{{ " active" }}{% endif %}">
3030
<a href="{{ '/' | relative_url }}" class="nav-link">

_includes/toc.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
{% endif %}
77

88
{% if enable_toc %}
9-
<div id="toc-wrapper" class="pl-0 pr-4 mb-5">
10-
<div class="panel-heading pl-3 pt-2 mb-2">{{- site.data.locales[include.lang].panel.toc -}}</div>
9+
<div id="toc-wrapper" class="ps-0 pe-4 mb-5">
10+
<div class="panel-heading ps-3 pt-2 mb-2">{{- site.data.locales[include.lang].panel.toc -}}</div>
1111
<nav id="toc"></nav>
1212
</div>
1313

_includes/topbar.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<!-- The Top Bar -->
22

33
<div id="topbar-wrapper">
4-
<div id="topbar" class="container d-flex align-items-center justify-content-between h-100 pl-3 pr-3 pl-md-4 pr-md-4">
4+
<div
5+
id="topbar"
6+
class="container d-flex align-items-center justify-content-between h-100 px-3 px-md-4 px-xxl-5"
7+
>
58
<span id="breadcrumb">
69
{% assign paths = page.url | split: '/' %}
710

_includes/trending-tags.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
{% if trending_tags.size > 0 %}
3737
<div id="access-tags">
3838
<div class="panel-heading">{{- site.data.locales[include.lang].panel.trending_tags -}}</div>
39-
<div class="d-flex flex-wrap mt-3 mb-1 mr-3">
39+
<div class="d-flex flex-wrap mt-3 mb-1 me-3">
4040
{% for tag_name in trending_tags %}
4141
{% assign url = tag_name | slugify | url_encode | prepend: '/tags/' | append: '/' %}
4242
<a class="post-tag btn btn-outline-primary" href="{{ url | relative_url }}">{{ tag_name }}</a>

_includes/update-list.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
{% if update_list.size > 0 %}
2727
<div id="access-lastmod" class="post">
2828
<div class="panel-heading">{{- site.data.locales[include.lang].panel.lastmod -}}</div>
29-
<ul class="post-content pl-0 pb-1 ml-1 mt-2">
29+
<ul class="post-content ps-0 pb-1 ms-1 mt-2">
3030
{% for item in update_list %}
3131
{% assign index = item | split: '::' | last | plus: 0 %}
3232
{% assign post = site.posts[index] %}

_javascript/modules/components/back-to-top.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@ export function back2top() {
1515
});
1616

1717
$('#back-to-top').on('click', () => {
18-
$('body,html').animate(
19-
{
20-
scrollTop: 0
21-
},
22-
800
23-
);
24-
return false;
18+
window.scrollTo(0, 0);
2519
});
2620
}

0 commit comments

Comments
 (0)