Skip to content

Commit 47a1e07

Browse files
build(deps): bump bootstrap from 4.4.1 to 5.5.3
1 parent 3920be6 commit 47a1e07

8 files changed

+148
-152
lines changed

_includes/footer-scripts.html

+1-10
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,7 @@
66

77
{% if layout.common-js %}
88
{% for js in layout.common-js %}
9-
<!-- doing something a bit funky here because I want to be careful not to include JQuery twice! -->
10-
{% if js contains 'jquery' %}
11-
<script>
12-
if (typeof jQuery == 'undefined') {
13-
document.write('<script src="{{ js | relative_url }}"></scr' + 'ipt>');
14-
}
15-
</script>
16-
{% else %}
17-
<script src="{{ js | relative_url }}"></script>
18-
{% endif %}
9+
<script src="{{ js | relative_url }}"></script>
1910
{% endfor %}
2011
{% endif %}
2112

_includes/nav.html

+50-48
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,64 @@
11
<nav class="navbar navbar-expand-xl navbar-light fixed-top navbar-custom {% if page.nav-short %}top-nav-short-permanent{% else %}top-nav-regular{% endif %}">
2+
<div class="container-fluid">
23

3-
{%- if site.title-img -%}
4-
<a class="navbar-brand navbar-brand-logo" href="{{ '/' | absolute_url }}"><img alt="{{ site.title }} Logo" src="{{ site.title-img | relative_url}}"/></a>
5-
{%- elsif site.title -%}
6-
<a class="navbar-brand" href="{{ '/' | absolute_url }}">{{ site.title }}</a>
7-
{%- endif -%}
4+
{%- if site.title-img -%}
5+
<a class="navbar-brand navbar-brand-logo" href="{{ '/' | absolute_url }}"><img alt="{{ site.title }} Logo" src="{{ site.title-img | relative_url}}"/></a>
6+
{%- elsif site.title -%}
7+
<a class="navbar-brand" href="{{ '/' | absolute_url }}">{{ site.title }}</a>
8+
{%- endif -%}
89

9-
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#main-navbar" aria-controls="main-navbar" aria-expanded="false" aria-label="Toggle navigation">
10-
<span class="navbar-toggler-icon"></span>
11-
</button>
10+
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#main-navbar" aria-controls="main-navbar" aria-expanded="false" aria-label="Toggle navigation">
11+
<span class="navbar-toggler-icon"></span>
12+
</button>
1213

13-
<div class="collapse navbar-collapse" id="main-navbar">
14-
<ul class="navbar-nav ml-auto">
15-
{%- for link in site.navbar-links -%}
16-
{%- if link[1].first %}
17-
<li class="nav-item dropdown">
18-
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{ link[0] }}</a>
19-
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
20-
{%- for childlink in link[1] -%}
21-
{%- for linkparts in childlink %}
22-
<a class="dropdown-item" href="{{ linkparts[1] | relative_url }}">{{ linkparts[0] }}</a>
23-
{%- endfor -%}
24-
{%- endfor %}
25-
</div>
26-
</li>
27-
{% else %}
14+
<div class="collapse navbar-collapse" id="main-navbar">
15+
<ul class="navbar-nav ms-auto">
16+
{%- for link in site.navbar-links -%}
17+
{%- if link[1].first %}
18+
<li class="nav-item dropdown">
19+
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">{{ link[0] }}</a>
20+
<div class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
21+
{%- for childlink in link[1] -%}
22+
{%- for linkparts in childlink %}
23+
<a class="dropdown-item" href="{{ linkparts[1] | relative_url }}">{{ linkparts[0] }}</a>
24+
{%- endfor -%}
25+
{%- endfor %}
26+
</div>
27+
</li>
28+
{% else %}
29+
<li class="nav-item">
30+
<a class="nav-link" href="{{ link[1] | relative_url }}">{{ link[0] }}</a>
31+
</li>
32+
{%- endif -%}
33+
{%- endfor -%}
34+
{% if site.post_search %}
2835
<li class="nav-item">
29-
<a class="nav-link" href="{{ link[1] | relative_url }}">{{ link[0] }}</a>
36+
<a class="nav-link" id="nav-search-link" href="#" title="Search">
37+
<span id="nav-search-icon" class="fa fa-search"></span>
38+
<span id="nav-search-text">Search</span>
39+
</a>
3040
</li>
3141
{%- endif -%}
32-
{%- endfor -%}
33-
{% if site.post_search %}
34-
<li class="nav-item">
35-
<a class="nav-link" id="nav-search-link" href="#" title="Search">
36-
<span id="nav-search-icon" class="fa fa-search"></span>
37-
<span id="nav-search-text">Search</span>
38-
</a>
39-
</li>
40-
{%- endif -%}
41-
</ul>
42-
</div>
42+
</ul>
43+
</div>
4344

44-
{% if site.navbar-extra %}
45-
{% for file in site.navbar-extra %}
46-
{% include {{ file }} %}
47-
{% endfor %}
48-
{% endif %}
45+
{% if site.navbar-extra %}
46+
{% for file in site.navbar-extra %}
47+
{% include {{ file }} %}
48+
{% endfor %}
49+
{% endif %}
4950

50-
{% if site.avatar and page.show-avatar != false %}
51-
<div class="avatar-container">
52-
<div class="avatar-img-border">
53-
<a href="{{ '/' | absolute_url }}">
54-
<img alt="Navigation bar avatar" class="avatar-img" src="{{ site.avatar | relative_url }}" />
55-
</a>
51+
{% if site.avatar and page.show-avatar != false %}
52+
<div class="avatar-container">
53+
<div class="avatar-img-border">
54+
<a href="{{ '/' | absolute_url }}">
55+
<img alt="Navigation bar avatar" class="avatar-img" src="{{ site.avatar | relative_url }}" />
56+
</a>
57+
</div>
5658
</div>
57-
</div>
58-
{% endif %}
59+
{% endif %}
5960

61+
</div>
6062
</nav>
6163

6264
{% include search.html %}

_includes/staticman-comments.html

-6
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,6 @@ <h3 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_labe
7272
</div>
7373

7474
<!-- Load script to handle comment form submission -->
75-
<!-- doing something a bit funky here because I want to be careful not to include JQuery twice! -->
76-
<script>
77-
if (typeof jQuery == 'undefined') {
78-
document.write('<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></scr' + 'ipt>');
79-
}
80-
</script>
8175
<script src="{{ "/assets/js/staticman.js" | relative_url }}"></script>
8276
</div>
8377
{% endif %}

_layouts/base.html

+4-8
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,14 @@
33
- "/assets/css/bootstrap-social.css"
44
- "/assets/css/beautifuljekyll.css"
55
common-ext-css:
6-
- href: "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
7-
sri: "sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
6+
- href: "https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
7+
sri: "sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"
88
- "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
99
- "https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic"
1010
- "https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800"
1111
common-ext-js:
12-
- href: "https://code.jquery.com/jquery-3.5.1.slim.min.js"
13-
sri: "sha256-4+XzXVhsDmqanXGHaHvgh1gMQKX40OUvDEBTu8JcmNs="
14-
- href: "https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"
15-
sri: "sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
16-
- href: "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
17-
sri: "sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
12+
- href: "https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
13+
sri: "sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
1814
common-js:
1915
- "/assets/js/beautifuljekyll.js"
2016
---

_layouts/minimal.html

+4-8
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@
22
common-css:
33
- "/assets/css/beautifuljekyll-minimal.css"
44
common-ext-css:
5-
- href: "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
6-
sri: "sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
5+
- href: "https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
6+
sri: "sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"
77
common-ext-js:
8-
- href: "https://code.jquery.com/jquery-3.5.1.slim.min.js"
9-
sri: "sha256-4+XzXVhsDmqanXGHaHvgh1gMQKX40OUvDEBTu8JcmNs="
10-
- href: "https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"
11-
sri: "sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
12-
- href: "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
13-
sri: "sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
8+
- href: "https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
9+
sri: "sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
1410
---
1511

1612
<!DOCTYPE html>

assets/css/beautifuljekyll.css

+5-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ body {
4848
body > main {
4949
flex: 1;
5050
}
51+
a {
52+
text-decoration: none; /* no underline */
53+
}
5154
p {
5255
line-height: 1.5;
5356
margin: 1.875rem 0;
@@ -95,6 +98,7 @@ hr.small {
9598
border-width: 0.25rem;
9699
border-color: inherit;
97100
border-radius: 0.1875rem;
101+
opacity: 0.65;
98102
}
99103

100104
/* fix in-page anchors to not be behind fixed header */
@@ -269,7 +273,7 @@ img {
269273
}
270274
}
271275

272-
.navbar-custom .nav-item.dropdown.show {
276+
.navbar-custom .dropdown-toggle.show {
273277
background: rgba(0, 0, 0, 0.2);
274278
}
275279

assets/js/beautifuljekyll.js

+60-49
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,29 @@
22

33
let BeautifulJekyllJS = {
44

5-
bigImgEl : null,
6-
numImgs : null,
5+
bigImgEl: null,
6+
numImgs: null,
77

8-
init : function() {
8+
init: function() {
99
setTimeout(BeautifulJekyllJS.initNavbar, 10);
1010

11+
let navbar = document.querySelector(".navbar");
12+
1113
// Shorten the navbar after scrolling a little bit down
12-
$(window).scroll(function() {
13-
if ($(".navbar").offset().top > 50) {
14-
$(".navbar").addClass("top-nav-short");
15-
} else {
16-
$(".navbar").removeClass("top-nav-short");
17-
}
14+
window.addEventListener('scroll', function() {
15+
if (window.scrollY > 50) {
16+
navbar.classList.add("top-nav-short");
17+
} else {
18+
navbar.classList.remove("top-nav-short");
19+
}
1820
});
1921

2022
// On mobile, hide the avatar when expanding the navbar menu
21-
$('#main-navbar').on('show.bs.collapse', function () {
22-
$(".navbar").addClass("top-nav-expanded");
23+
document.getElementById('main-navbar').addEventListener('show.bs.collapse', function() {
24+
navbar.classList.add("top-nav-expanded");
2325
});
24-
$('#main-navbar').on('hidden.bs.collapse', function () {
25-
$(".navbar").removeClass("top-nav-expanded");
26+
document.getElementById('main-navbar').addEventListener('hidden.bs.collapse', function() {
27+
navbar.classList.remove("top-nav-expanded");
2628
});
2729

2830
// show the big header image
@@ -31,26 +33,30 @@ let BeautifulJekyllJS = {
3133
BeautifulJekyllJS.initSearch();
3234
},
3335

34-
initNavbar : function() {
36+
initNavbar: function() {
3537
// Set the navbar-dark/light class based on its background color
36-
const rgb = $('.navbar').css("background-color").replace(/[^\d,]/g,'').split(",");
38+
const rgb = getComputedStyle(document.querySelector('.navbar')).backgroundColor.replace(/[^\d,]/g, '').split(",");
3739
const brightness = Math.round(( // http://www.w3.org/TR/AERT#color-contrast
3840
parseInt(rgb[0]) * 299 +
3941
parseInt(rgb[1]) * 587 +
4042
parseInt(rgb[2]) * 114
4143
) / 1000);
44+
45+
let navbar = document.querySelector(".navbar");
4246
if (brightness <= 125) {
43-
$(".navbar").removeClass("navbar-light").addClass("navbar-dark");
47+
navbar.classList.remove("navbar-light");
48+
navbar.classList.add("navbar-dark");
4449
} else {
45-
$(".navbar").removeClass("navbar-dark").addClass("navbar-light");
50+
navbar.classList.remove("navbar-dark");
51+
navbar.classList.add("navbar-light");
4652
}
4753
},
4854

49-
initImgs : function() {
50-
// If the page was large images to randomly select from, choose an image
51-
if ($("#header-big-imgs").length > 0) {
52-
BeautifulJekyllJS.bigImgEl = $("#header-big-imgs");
53-
BeautifulJekyllJS.numImgs = BeautifulJekyllJS.bigImgEl.attr("data-num-img");
55+
initImgs: function() {
56+
// If the page has large images to randomly select from, choose an image
57+
if (document.getElementById("header-big-imgs")) {
58+
BeautifulJekyllJS.bigImgEl = document.getElementById("header-big-imgs");
59+
BeautifulJekyllJS.numImgs = BeautifulJekyllJS.bigImgEl.getAttribute("data-num-img");
5460

5561
// 2fc73a3a967e97599c9763d05e564189
5662
// set an initial image
@@ -69,19 +75,19 @@ let BeautifulJekyllJS = {
6975
prefetchImg.src = src;
7076
// if I want to do something once the image is ready: `prefetchImg.onload = function(){}`
7177

72-
setTimeout(function(){
73-
const img = $("<div></div>").addClass("big-img-transition").css("background-image", 'url(' + src + ')');
74-
$(".intro-header.big-img").prepend(img);
75-
setTimeout(function(){ img.css("opacity", "1"); }, 50);
78+
setTimeout(function() {
79+
const img = document.createElement("div");
80+
img.className = "big-img-transition";
81+
img.style.backgroundImage = 'url(' + src + ')';
82+
document.querySelector(".intro-header.big-img").prepend(img);
83+
setTimeout(function() { img.style.opacity = "1"; }, 50);
7684

7785
// after the animation of fading in the new image is done, prefetch the next one
78-
//img.one("transitioned webkitTransitionEnd oTransitionEnd MSTransitionEnd", function(){
7986
setTimeout(function() {
8087
BeautifulJekyllJS.setImg(src, desc);
8188
img.remove();
8289
getNextImg();
8390
}, 1000);
84-
//});
8591
}, 6000);
8692
};
8793

@@ -92,46 +98,51 @@ let BeautifulJekyllJS = {
9298
}
9399
},
94100

95-
getImgInfo : function() {
101+
getImgInfo: function() {
96102
const randNum = Math.floor((Math.random() * BeautifulJekyllJS.numImgs) + 1);
97-
const src = BeautifulJekyllJS.bigImgEl.attr("data-img-src-" + randNum);
98-
const desc = BeautifulJekyllJS.bigImgEl.attr("data-img-desc-" + randNum);
103+
const src = BeautifulJekyllJS.bigImgEl.getAttribute("data-img-src-" + randNum);
104+
const desc = BeautifulJekyllJS.bigImgEl.getAttribute("data-img-desc-" + randNum);
99105

100106
return {
101-
src : src,
102-
desc : desc
107+
src: src,
108+
desc: desc
103109
}
104110
},
105111

106-
setImg : function(src, desc) {
107-
$(".intro-header.big-img").css("background-image", 'url(' + src + ')');
112+
setImg: function(src, desc) {
113+
document.querySelector(".intro-header.big-img").style.backgroundImage = 'url(' + src + ')';
114+
115+
let imgDesc = document.querySelector(".img-desc");
108116
if (typeof desc !== typeof undefined && desc !== false) {
109-
$(".img-desc").text(desc).show();
117+
imgDesc.textContent = desc;
118+
imgDesc.style.display = "block";
110119
} else {
111-
$(".img-desc").hide();
120+
imgDesc.style.display = "none";
112121
}
113122
},
114123

115-
initSearch : function() {
124+
initSearch: function() {
116125
if (!document.getElementById("beautifuljekyll-search-overlay")) {
117126
return;
118127
}
119128

120-
$("#nav-search-link").click(function(e) {
129+
document.getElementById("nav-search-link").addEventListener('click', function(e) {
121130
e.preventDefault();
122-
$("#beautifuljekyll-search-overlay").show();
123-
$("#nav-search-input").focus().select();
124-
$("body").addClass("overflow-hidden");
131+
document.getElementById("beautifuljekyll-search-overlay").style.display = "block";
132+
const searchInput = document.getElementById("nav-search-input");
133+
searchInput.focus();
134+
searchInput.select();
135+
document.body.classList.add("overflow-hidden");
125136
});
126-
$("#nav-search-exit").click(function(e) {
137+
document.getElementById("nav-search-exit").addEventListener('click', function(e) {
127138
e.preventDefault();
128-
$("#beautifuljekyll-search-overlay").hide();
129-
$("body").removeClass("overflow-hidden");
139+
document.getElementById("beautifuljekyll-search-overlay").style.display = "none";
140+
document.body.classList.remove("overflow-hidden");
130141
});
131-
$(document).on('keyup', function(e) {
132-
if (e.key == "Escape") {
133-
$("#beautifuljekyll-search-overlay").hide();
134-
$("body").removeClass("overflow-hidden");
142+
document.addEventListener('keyup', function(e) {
143+
if (e.key === "Escape") {
144+
document.getElementById("beautifuljekyll-search-overlay").style.display = "none";
145+
document.body.classList.remove("overflow-hidden");
135146
}
136147
});
137148
}

0 commit comments

Comments
 (0)