-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
25 changed files
with
595 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (C) 2013 by Oliver Nightingale | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
remote_theme: mmistakes/[email protected] | ||
#theme: minimal-mistakes-jekyll | ||
minimal_mistakes_skin: "midnight" # "default", "air", "aqua", "contrast", "dark", "dirt", "midnight", "mint", "neon", "plum", "sunrise" | ||
skin_switchable: true | ||
|
||
# Disable caching of content to disk in order to skip creating a .jekyll-cache or similar directory | ||
disable_disk_cache: true | ||
|
@@ -68,10 +69,11 @@ exclude: | |
- Gemfile.lock | ||
- node_modules | ||
# Shell we add to the generated _site as well? | ||
- LICENSE.minimal-mistakes | ||
- LICENSE.midnight | ||
- LICENSE.* | ||
|
||
# Sass/SCSS | ||
# If you are using Sass @import statements, you’ll need to ensure that your sass_dir is set to the base directory that contains your Sass files | ||
# https://jekyllrb.com/docs/assets/#sassscss | ||
sass: | ||
sass_dir: _sass/minimal-mistakes | ||
style: compressed # https://sass-lang.com/documentation/file.SASS_REFERENCE.html#output_style | ||
|
@@ -204,10 +206,15 @@ kramdown: | |
atom_feed: | ||
hide: true | ||
|
||
# https://jch.penibelst.de/ | ||
compress_html: | ||
profile: true | ||
clippings: all | ||
ignore: | ||
envs: development # disable compression in dev environment | ||
endings: all | ||
ignore: | ||
# do not use yet, too slow and can cause issues in the final output | ||
# envs: [ development ] disable compression in a given environment | ||
envs: all | ||
|
||
# These are introduced with our customized theme source, not part of mmistakes/minimal-mistakes | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
{% comment %} | ||
<!-- Dynamic loading of the user selected skin stylesheet --> | ||
{% endcomment %} | ||
|
||
{% comment %}<!-- NOTE: the 'default' skin is in the 'main.css', see the main.scss file for details -->{% endcomment %} | ||
<link rel="stylesheet" id="skinedStylesheet" href="{{ '/assets/css/main.css' | relative_url }}"> | ||
|
||
<style> | ||
#full-page-container.full-page-container { | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
display: contents; | ||
} | ||
|
||
#full-page-container.hidden { | ||
visibility: hidden; | ||
display: none; | ||
} | ||
</style> | ||
|
||
<script async="false"> | ||
|
||
const docRoot = '{{ site.baseurl }}'; | ||
const darkSkin = 'midnight'; | ||
const lightSkin = 'default'; | ||
|
||
function docPrefix() { | ||
return (docRoot != '' ? docRoot + '/' : ''); | ||
} | ||
|
||
function setCookie(name, value, days) { | ||
var expires = ""; | ||
if (days) { | ||
var date = new Date(); | ||
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); | ||
expires = "; expires=" + date.toUTCString(); | ||
} | ||
document.cookie = name + "=" + (value || "") + expires + "; path=/; SameSite=Strict"; | ||
} | ||
|
||
function getCookie(name, defaultValue = null) { | ||
var nameEQ = name + "="; | ||
var ca = document.cookie.split(';'); | ||
for (var i = 0; i < ca.length; i++) { | ||
var c = ca[i]; | ||
while (c.charAt(0) == ' ') { | ||
c = c.substring(1, c.length); | ||
} | ||
if (c.indexOf(nameEQ) == 0) { | ||
return c.substring(nameEQ.length, c.length); | ||
} | ||
} | ||
return defaultValue; | ||
} | ||
|
||
(function () { | ||
function setSkin(skin) { | ||
const stylesheet = document.getElementById('skinedStylesheet'); | ||
//stylesheet.onload = saveChanges; | ||
stylesheet.href = docPrefix() + '/assets/css/main' + (skin == 'default' ? '' : '_' + skin) + '.css'; | ||
setCookie('skin', skin, 365 * 100); | ||
} | ||
|
||
function toggleSkin(event) { | ||
if (getCookie('skin', 'default') == darkSkin) { | ||
event.target.classList.remove('fa-toggle-on'); | ||
event.target.classList.add('fa-toggle-off'); | ||
setSkin(lightSkin); | ||
} | ||
else { | ||
event.target.classList.remove('fa-toggle-off'); | ||
event.target.classList.add('fa-toggle-on'); | ||
setSkin(darkSkin); | ||
} | ||
event.currentTarget.blur(); | ||
} | ||
|
||
function toggleIcon(target, off) { | ||
if (off) { | ||
target.classList.remove('fa-toggle-on'); | ||
target.classList.add('fa-toggle-off'); | ||
} | ||
else { | ||
target.classList.remove('fa-toggle-off'); | ||
target.classList.add('fa-toggle-on'); | ||
} | ||
} | ||
|
||
function toggleSkin(event) { | ||
var off = getCookie('skin', 'default') == darkSkin; | ||
|
||
if (off) | ||
setSkin(lightSkin); | ||
else | ||
setSkin(darkSkin); | ||
toggleIcon(event.target, off); | ||
|
||
event.currentTarget.blur(); | ||
} | ||
|
||
/* As of the dynamic skin stylsheet loading, it is better to wait for the finish of the whole page content load and rendering to avoid apperance of | ||
half rendered content parts (it is better to see an empty content even if it might appear in a different bacground color that the skin has) | ||
*/ | ||
window.addEventListener("load", function () { | ||
function saveChanges() { | ||
const htmlStyle = window.getComputedStyle(document.documentElement); | ||
const backgroundColor = htmlStyle.backgroundColor; | ||
setCookie('skin-background-color', backgroundColor, 365 * 100); | ||
}; | ||
|
||
var container = document.getElementById("full-page-container"); | ||
if (container) | ||
container.classList.remove('hidden'); | ||
|
||
// Why this is not working?!?! | ||
//document.body.style.removeProperty("backgroundColor"); | ||
document.body.style.backgroundColor = ""; | ||
if (storedSkin !== 'default') | ||
toggleIcon($('#skin-button').find('.masthead_button_icon')[0], false); | ||
|
||
$("#skin-button").on("click", toggleSkin); | ||
|
||
saveChanges(); | ||
}); | ||
|
||
document.addEventListener("DOMContentLoaded", function () { | ||
const skinBackgroundColor = getCookie('skin-background-color'); | ||
if (skinBackgroundColor) | ||
document.body.style.backgroundColor = skinBackgroundColor; | ||
}); | ||
|
||
const storedSkin = getCookie('skin', 'default'); | ||
if (storedSkin !== 'default') | ||
setSkin(storedSkin); | ||
|
||
})(); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.