Merge tag '6.0.1'
This commit is contained in:
commit
a6fe22b283
25 changed files with 599 additions and 159 deletions
|
@ -20,6 +20,7 @@ body {
|
|||
background-image: url({{ site.page-img | relative_url }});
|
||||
background-attachment: fixed;
|
||||
{% endif %}
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
p {
|
||||
line-height: 1.5;
|
||||
|
@ -246,22 +247,28 @@ img {
|
|||
}
|
||||
|
||||
.navbar-custom .nav-item.dropdown .dropdown-menu {
|
||||
min-width: 0;
|
||||
margin-top: 0;
|
||||
font-size: 1em;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
{% if site.navbar-var-length %}
|
||||
min-width: 100%;
|
||||
{% else %}
|
||||
min-width: 0;
|
||||
width: 100%;
|
||||
word-break: break-word;
|
||||
{% endif %}
|
||||
}
|
||||
|
||||
.navbar-custom .nav-item.dropdown .dropdown-menu .dropdown-item {
|
||||
white-space: normal;
|
||||
padding: 0.625rem;
|
||||
background-color: {{ site.navbar-col | default: "#EAEAEA" }};
|
||||
text-decoration: none !important;
|
||||
border-width: 0 1px 1px 1px;
|
||||
font-weight: normal;
|
||||
color: {{ site.navbar-text-col | default: "#404040" }};
|
||||
{% unless site.navbar-var-length %}
|
||||
white-space: normal;
|
||||
{% endunless %}
|
||||
}
|
||||
|
||||
@media (min-width: 1200px) {
|
||||
|
@ -274,6 +281,10 @@ img {
|
|||
border: 1px solid {{ site.navbar-border-col | default: "#DDDDDD" }};
|
||||
border-width: 0 1px 1px;
|
||||
}
|
||||
|
||||
.navbar-custom .nav-item.dropdown .dropdown-menu .dropdown-item:first-child {
|
||||
border-top-width: 1px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1199px) {
|
||||
|
@ -388,6 +399,11 @@ footer a {
|
|||
color: {{ site.footer-link-col | default: "#404040" }};
|
||||
}
|
||||
|
||||
footer a:hover,
|
||||
footer a:focus {
|
||||
color: {{ site.footer-hover-col | default: "#0085A1" }};
|
||||
}
|
||||
|
||||
footer .list-inline {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
@ -426,6 +442,10 @@ footer .footer-custom-content {
|
|||
|
||||
/* --- Post preview (feed) --- */
|
||||
|
||||
.posts-list {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.post-preview {
|
||||
padding: 1.25rem 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
|
@ -556,6 +576,10 @@ footer .footer-custom-content {
|
|||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.blog-tags .list-inline-item {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.blog-tags a {
|
||||
color: {{ site.text-col | default: "#404040" }};
|
||||
text-decoration: none;
|
||||
|
@ -993,3 +1017,104 @@ pre {
|
|||
display: block;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/* Search bar */
|
||||
#beautifuljekyll-search-overlay {
|
||||
display: none;
|
||||
z-index: 999999;
|
||||
position: fixed;
|
||||
background: rgba(0,0,0,0.9);
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
text-align: center;
|
||||
padding: 1rem;
|
||||
}
|
||||
#nav-search-exit {
|
||||
position: absolute;
|
||||
top: 1.5rem;
|
||||
cursor: pointer;
|
||||
right: 25%;
|
||||
margin-right: 2rem;
|
||||
color: #555;
|
||||
font-size: 2rem;
|
||||
line-height: 2rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
#nav-search-exit:hover {
|
||||
color: #000;
|
||||
}
|
||||
#nav-search-input {
|
||||
text-align: center;
|
||||
background: #e7edee;
|
||||
margin: auto;
|
||||
display: block;
|
||||
font-size: 2rem;
|
||||
width: 50%;
|
||||
transition: width 300ms ease;
|
||||
color: #222;
|
||||
border-radius: 5rem;
|
||||
outline: none;
|
||||
border: none;
|
||||
padding: 0 3rem;
|
||||
}
|
||||
@media (max-width: 1199px) {
|
||||
#nav-search-input {
|
||||
width: 75%;
|
||||
}
|
||||
#nav-search-exit {
|
||||
right: 12.5%;
|
||||
}
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
#nav-search-input {
|
||||
width: 100%;
|
||||
}
|
||||
#nav-search-exit {
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
#nav-search-input:focus {
|
||||
background: #f3f8fe;
|
||||
box-shadow: 0px 0.15rem 1rem #e7f4ff;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#nav-search-input::placeholder {
|
||||
color: #777;
|
||||
}
|
||||
|
||||
#search-results-container {
|
||||
list-style: none;
|
||||
padding-left: unset;
|
||||
margin-top: 1.5rem;
|
||||
color: #fff;
|
||||
font-size: 1.5rem;
|
||||
max-height: calc(100vh - 6.5rem);
|
||||
overflow-y: auto;
|
||||
}
|
||||
#search-results-container a {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
#search-results-container a:hover {
|
||||
color: #fff;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#nav-search-icon {
|
||||
display: inline-block;
|
||||
}
|
||||
#nav-search-text {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (max-width: 1199px) {
|
||||
#nav-search-icon {
|
||||
display: none;
|
||||
}
|
||||
#nav-search-text {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Dean Attali / Beautiful Jekyll 2020
|
||||
// Dean Attali / Beautiful Jekyll 2023
|
||||
|
||||
var BeautifulJekyllJS = {
|
||||
let BeautifulJekyllJS = {
|
||||
|
||||
bigImgEl : null,
|
||||
numImgs : null,
|
||||
|
@ -27,6 +27,8 @@ var BeautifulJekyllJS = {
|
|||
|
||||
// show the big header image
|
||||
BeautifulJekyllJS.initImgs();
|
||||
|
||||
BeautifulJekyllJS.initSearch();
|
||||
},
|
||||
|
||||
initNavbar : function() {
|
||||
|
@ -52,23 +54,23 @@ var BeautifulJekyllJS = {
|
|||
|
||||
// 2fc73a3a967e97599c9763d05e564189
|
||||
// set an initial image
|
||||
var imgInfo = BeautifulJekyllJS.getImgInfo();
|
||||
var src = imgInfo.src;
|
||||
var desc = imgInfo.desc;
|
||||
const imgInfo = BeautifulJekyllJS.getImgInfo();
|
||||
const src = imgInfo.src;
|
||||
const desc = imgInfo.desc;
|
||||
BeautifulJekyllJS.setImg(src, desc);
|
||||
|
||||
// For better UX, prefetch the next image so that it will already be loaded when we want to show it
|
||||
var getNextImg = function() {
|
||||
var imgInfo = BeautifulJekyllJS.getImgInfo();
|
||||
var src = imgInfo.src;
|
||||
var desc = imgInfo.desc;
|
||||
const getNextImg = function() {
|
||||
const imgInfo = BeautifulJekyllJS.getImgInfo();
|
||||
const src = imgInfo.src;
|
||||
const desc = imgInfo.desc;
|
||||
|
||||
var prefetchImg = new Image();
|
||||
const prefetchImg = new Image();
|
||||
prefetchImg.src = src;
|
||||
// if I want to do something once the image is ready: `prefetchImg.onload = function(){}`
|
||||
|
||||
setTimeout(function(){
|
||||
var img = $("<div></div>").addClass("big-img-transition").css("background-image", 'url(' + src + ')');
|
||||
const img = $("<div></div>").addClass("big-img-transition").css("background-image", 'url(' + src + ')');
|
||||
$(".intro-header.big-img").prepend(img);
|
||||
setTimeout(function(){ img.css("opacity", "1"); }, 50);
|
||||
|
||||
|
@ -91,9 +93,9 @@ var BeautifulJekyllJS = {
|
|||
},
|
||||
|
||||
getImgInfo : function() {
|
||||
var randNum = Math.floor((Math.random() * BeautifulJekyllJS.numImgs) + 1);
|
||||
var src = BeautifulJekyllJS.bigImgEl.attr("data-img-src-" + randNum);
|
||||
var desc = BeautifulJekyllJS.bigImgEl.attr("data-img-desc-" + randNum);
|
||||
const randNum = Math.floor((Math.random() * BeautifulJekyllJS.numImgs) + 1);
|
||||
const src = BeautifulJekyllJS.bigImgEl.attr("data-img-src-" + randNum);
|
||||
const desc = BeautifulJekyllJS.bigImgEl.attr("data-img-desc-" + randNum);
|
||||
|
||||
return {
|
||||
src : src,
|
||||
|
@ -108,6 +110,30 @@ var BeautifulJekyllJS = {
|
|||
} else {
|
||||
$(".img-desc").hide();
|
||||
}
|
||||
},
|
||||
|
||||
initSearch : function() {
|
||||
if (!document.getElementById("beautifuljekyll-search-overlay")) {
|
||||
return;
|
||||
}
|
||||
|
||||
$("#nav-search-link").click(function(e) {
|
||||
e.preventDefault();
|
||||
$("#beautifuljekyll-search-overlay").show();
|
||||
$("#nav-search-input").focus().select();
|
||||
$("body").addClass("overflow-hidden");
|
||||
});
|
||||
$("#nav-search-exit").click(function(e) {
|
||||
e.preventDefault();
|
||||
$("#beautifuljekyll-search-overlay").hide();
|
||||
$("body").removeClass("overflow-hidden");
|
||||
});
|
||||
$(document).on('keyup', function(e) {
|
||||
if (e.key == "Escape") {
|
||||
$("#beautifuljekyll-search-overlay").hide();
|
||||
$("body").removeClass("overflow-hidden");
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -3,40 +3,51 @@ layout: null
|
|||
---
|
||||
|
||||
(function ($) {
|
||||
var $comments = $('.js-comments');
|
||||
|
||||
$('#new_comment').submit(function () {
|
||||
var form = this;
|
||||
const form = this;
|
||||
|
||||
$(form).addClass('disabled');
|
||||
|
||||
{% assign sm = site.staticman -%}
|
||||
var endpoint = '{{ sm.endpoint | default: "https://staticman3.herokuapp.com/v3/entry/github/" }}';
|
||||
var repository = '{{ sm.repository }}';
|
||||
var branch = '{{ sm.branch }}';
|
||||
const endpoint = '{{ sm.endpoint }}';
|
||||
const repository = '{{ sm.repository }}';
|
||||
const branch = '{{ sm.branch }}';
|
||||
const url = endpoint + repository + '/' + branch + '/comments';
|
||||
const data = $(this).serialize();
|
||||
|
||||
$.ajax({
|
||||
type: $(this).attr('method'),
|
||||
url: endpoint + repository + '/' + branch + '/comments',
|
||||
data: $(this).serialize(),
|
||||
contentType: 'application/x-www-form-urlencoded',
|
||||
success: function (data) {
|
||||
$('#comment-form-submit').addClass('d-none');
|
||||
$('#comment-form-submitted').removeClass('d-none');
|
||||
$('.page__comments-form .js-notice').removeClass('alert-danger');
|
||||
$('.page__comments-form .js-notice').addClass('alert-success');
|
||||
showAlert('success');
|
||||
},
|
||||
error: function (err) {
|
||||
console.log(err);
|
||||
$('#comment-form-submitted').addClass('d-none');
|
||||
$('#comment-form-submit').removeClass('d-none');
|
||||
$('.page__comments-form .js-notice').removeClass('alert-success');
|
||||
$('.page__comments-form .js-notice').addClass('alert-danger');
|
||||
showAlert('failure');
|
||||
$(form).removeClass('disabled');
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", url);
|
||||
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
||||
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
|
||||
xhr.onreadystatechange = function () {
|
||||
if(xhr.readyState === XMLHttpRequest.DONE) {
|
||||
const status = xhr.status;
|
||||
if (status >= 200 && status < 400) {
|
||||
formSubmitted();
|
||||
} else {
|
||||
formError();
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function formSubmitted() {
|
||||
$('#comment-form-submit').addClass('d-none');
|
||||
$('#comment-form-submitted').removeClass('d-none');
|
||||
$('.page__comments-form .js-notice').removeClass('alert-danger');
|
||||
$('.page__comments-form .js-notice').addClass('alert-success');
|
||||
showAlert('success');
|
||||
}
|
||||
|
||||
function formError() {
|
||||
$('#comment-form-submitted').addClass('d-none');
|
||||
$('#comment-form-submit').removeClass('d-none');
|
||||
$('.page__comments-form .js-notice').removeClass('alert-success');
|
||||
$('.page__comments-form .js-notice').addClass('alert-danger');
|
||||
showAlert('failure');
|
||||
$(form).removeClass('disabled');
|
||||
}
|
||||
|
||||
xhr.send(data);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue