forked from alshedivat/al-folio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move libs versions to config (alshedivat#2139)
Moved libs versions and hashes to `_config.yml`. Fixes alshedivat#2067. Deferring everything possible to keep pages loads fast. --------- Signed-off-by: George Araújo <[email protected]>
- Loading branch information
1 parent
ef84782
commit 06bc367
Showing
15 changed files
with
267 additions
and
148 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
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 |
---|---|---|
|
@@ -17,15 +17,17 @@ | |
{% endif %} | ||
|
||
<!-- Fonts & Icons --> | ||
<link rel="stylesheet" href="{{ '/assets/css/academicons.min.css' | relative_url | bust_file_cache }}"> | ||
<link defer rel="stylesheet" href="{{ '/assets/css/academicons.min.css' | relative_url | bust_file_cache }}"> | ||
<link | ||
defer | ||
rel="stylesheet" | ||
type="text/css" | ||
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Roboto+Slab:100,300,400,500,700|Material+Icons" | ||
> | ||
|
||
<!-- Code Syntax Highlighting --> | ||
<link | ||
defer | ||
rel="stylesheet" | ||
href="{{ '/assets/css/jekyll-pygments-themes-github.css' | relative_url | bust_file_cache }}" | ||
media="" | ||
|
@@ -34,11 +36,7 @@ | |
|
||
{% if page.toc and page.toc.sidebar %} | ||
<!-- Sidebar Table of Contents --> | ||
<link href="{{ '/assets/css/bootstrap-toc.min.css' | relative_url | bust_file_cache }}" rel="stylesheet"> | ||
{% endif %} | ||
{% if page.tikzjax %} | ||
<link defer rel="stylesheet" type="text/css" href="https://tikzjax.com/v1/fonts.css"> | ||
<script defer src="https://tikzjax.com/v1/tikzjax.js"></script> | ||
<link defer href="{{ '/assets/css/bootstrap-toc.min.css' | relative_url | bust_file_cache }}" rel="stylesheet"> | ||
{% endif %} | ||
|
||
<!-- Styles --> | ||
|
@@ -56,6 +54,7 @@ | |
<!-- Dark Mode --> | ||
{% if site.enable_darkmode %} | ||
<link | ||
defer | ||
rel="stylesheet" | ||
href="{{ '/assets/css/jekyll-pygments-themes-native.css' | relative_url | bust_file_cache }}" | ||
media="none" | ||
|
@@ -67,39 +66,62 @@ | |
<!-- GeoJSON support via Leaflet --> | ||
{% if page.map %} | ||
<link | ||
defer | ||
rel="stylesheet" | ||
href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" | ||
integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" | ||
href="https://unpkg.com/leaflet@{{ site.leaflet.version }}/dist/leaflet.css" | ||
integrity="{{ site.leaflet.integrity.css }}" | ||
crossorigin="" | ||
> | ||
{% endif %} | ||
|
||
<!-- diff2html --> | ||
{% if page.code_diff %} | ||
<link | ||
defer | ||
rel="stylesheet" | ||
href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/github.min.css" | ||
href="https://cdn.jsdelivr.net/npm/highlight.js@{{ site.highlightjs.version }}/styles/github.min.css" | ||
integrity="{{ site.highlightjs.integrity.css.light }}" | ||
crossorigin="anonymous" | ||
media="screen and (prefers-color-scheme: light)" | ||
> | ||
<link | ||
defer | ||
rel="stylesheet" | ||
href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/github-dark.min.css" | ||
href="https://cdn.jsdelivr.net/npm/highlight.js@{{ site.highlightjs.version }}/styles/github-dark.min.css" | ||
integrity="{{ site.highlightjs.integrity.css.dark }}" | ||
crossorigin="anonymous" | ||
media="screen and (prefers-color-scheme: dark)" | ||
> | ||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/diff2html/bundles/css/diff2html.min.css"> | ||
<link | ||
defer | ||
rel="stylesheet" | ||
href="https://cdn.jsdelivr.net/npm/diff2html@{{ site.diff2html.version }}/bundles/css/diff2html.min.css" | ||
integrity="{{ site.diff2html.integrity.css }}" | ||
crossorigin="anonymous" | ||
> | ||
{% endif %} | ||
|
||
<!-- Image comparison slider --> | ||
{% if page.images %} | ||
<!-- Image comparison slider --> | ||
{% if page.images.compare %} | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/styles.min.css"> | ||
<link | ||
defer | ||
rel="stylesheet" | ||
href="https://cdn.jsdelivr.net/npm/img-comparison-slider@{{ site.img-comparison-slider.version }}/dist/styles.min.css" | ||
> | ||
{% endif %} | ||
<!-- Image slider --> | ||
{% if page.images.slider %} | ||
<link | ||
defer | ||
rel="stylesheet" | ||
href="https://cdn.jsdelivr.net/npm/swiper@11.0.5/swiper-bundle.min.css" | ||
integrity="sha256-yUoNxsvX+Vo8Trj3lZ/Y5ZBf8HlBFsB6Xwm7rH75/9E=" | ||
href="https://cdn.jsdelivr.net/npm/swiper@{{ site.swiper.version }}/swiper-bundle.min.css" | ||
integrity="{{ site.swiper.integrity.css }}" | ||
crossorigin="anonymous" | ||
> | ||
{% endif %} | ||
{% endif %} | ||
|
||
{% if page.tikzjax %} | ||
<link defer rel="stylesheet" type="text/css" href="https://tikzjax.com/v1/fonts.css"> | ||
{% endif %} |
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 was deleted.
Oops, something went wrong.
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,31 @@ | ||
{% if page.code_diff %} | ||
<!-- diff2html doesn't go well with Bootstrap Table --> | ||
<script | ||
defer | ||
src="https://cdn.jsdelivr.net/npm/diff2html@{{ site.diff2html.version }}/bundles/js/diff2html-ui.min.js" | ||
integrity="{{ site.diff2html.integrity.js }}" | ||
crossorigin="anonymous" | ||
></script> | ||
<script> | ||
let theme = localStorage.getItem('theme'); | ||
/* Create echarts chart as another node and hide the code block, appending the echarts node after it | ||
this is done to enable retrieving the code again when changing theme between light/dark */ | ||
document.onreadystatechange = () => { | ||
if (document.readyState === 'complete') { | ||
document.querySelectorAll('pre>code.language-diff2html').forEach((elem) => { | ||
const textData = elem.textContent; | ||
const backup = elem.parentElement; | ||
backup.classList.add('unloaded'); | ||
/* create diff node */ | ||
let diffElement = document.createElement('div'); | ||
diffElement.classList.add('diff2html'); | ||
backup.after(diffElement); | ||
const configuration = { colorScheme: theme, drawFileList: true, highlight: true, matching: 'lines' }; | ||
const diff2htmlUi = new Diff2HtmlUI(diffElement, textData, configuration); | ||
diff2htmlUi.draw(); | ||
}); | ||
} | ||
}; | ||
</script> | ||
{% endif %} |
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 |
---|---|---|
@@ -1,13 +1,15 @@ | ||
{% if page.chart and page.chart.echarts %} | ||
<script | ||
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.min.js" | ||
integrity="sha256-EVZCmhajjLhgTcxlGMGUBtQiYULZCPjt0uNTFEPFTRk=" | ||
defer | ||
src="https://cdn.jsdelivr.net/npm/echarts@{{ site.echarts.version }}/dist/echarts.min.js" | ||
integrity="{{ site.echarts.integrity.library }}" | ||
crossorigin="anonymous" | ||
></script> | ||
{% if site.enable_darkmode %} | ||
<script | ||
src="https://cdn.jsdelivr.net/npm/[email protected]/theme/dark-fresh-cut.js" | ||
integrity="sha256-UmFIP/4VvOqBDIl2QWl1HBuAJ1XWs/iFZxT5yJRZOKo=" | ||
defer | ||
src="https://cdn.jsdelivr.net/npm/echarts@{{ site.echarts.version }}/theme/dark-fresh-cut.js" | ||
integrity="{{ site.echarts.integrity.dark_theme }}" | ||
crossorigin="anonymous" | ||
></script> | ||
{% endif %} | ||
|
@@ -16,26 +18,30 @@ | |
/* Create echarts chart as another node and hide the code block, appending the echarts node after it | ||
this is done to enable retrieving the code again when changing theme between light/dark */ | ||
document.querySelectorAll('pre>code.language-echarts').forEach((elem) => { | ||
const jsonData = elem.textContent; | ||
const backup = elem.parentElement; | ||
backup.classList.add('unloaded'); | ||
/* create echarts node */ | ||
let chartElement = document.createElement('div'); | ||
chartElement.classList.add('echarts'); | ||
backup.after(chartElement); | ||
document.onreadystatechange = () => { | ||
if (document.readyState === 'complete') { | ||
document.querySelectorAll('pre>code.language-echarts').forEach((elem) => { | ||
const jsonData = elem.textContent; | ||
const backup = elem.parentElement; | ||
backup.classList.add('unloaded'); | ||
/* create echarts node */ | ||
let chartElement = document.createElement('div'); | ||
chartElement.classList.add('echarts'); | ||
backup.after(chartElement); | ||
/* create echarts */ | ||
if (theme === 'dark') { | ||
var chart = echarts.init(chartElement, 'dark-fresh-cut'); | ||
} else { | ||
var chart = echarts.init(chartElement); | ||
} | ||
/* create echarts */ | ||
if (theme === 'dark') { | ||
var chart = echarts.init(chartElement, 'dark-fresh-cut'); | ||
} else { | ||
var chart = echarts.init(chartElement); | ||
} | ||
chart.setOption(JSON.parse(jsonData)); | ||
window.addEventListener('resize', function () { | ||
chart.resize(); | ||
}); | ||
}); | ||
chart.setOption(JSON.parse(jsonData)); | ||
window.addEventListener('resize', function () { | ||
chart.resize(); | ||
}); | ||
}); | ||
} | ||
}; | ||
</script> | ||
{% endif %} |
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 |
---|---|---|
@@ -1,11 +1,12 @@ | ||
{% if page.images %} | ||
{% if page.images.compare %} | ||
<script src="https://cdn.jsdelivr.net/npm/img-comparison-slider@8.0/dist/index.min.js"></script> | ||
<script defer src="https://cdn.jsdelivr.net/npm/img-comparison-slider@{{ site.img-comparison-slider.version }}/dist/index.min.js"></script> | ||
{% endif %} | ||
{% if page.images.slider %} | ||
<script | ||
src="https://cdn.jsdelivr.net/npm/[email protected]/swiper-element-bundle.min.js" | ||
integrity="sha256-BPrwikijIybg9OQC5SYFFqhBjERYOn97tCureFgYH1E=" | ||
defer | ||
src="https://cdn.jsdelivr.net/npm/swiper@{{ site.swiper.version }}/swiper-element-bundle.min.js" | ||
integrity="{{ site.swiper.integrity.js }}" | ||
crossorigin="anonymous" | ||
></script> | ||
{% endif %} | ||
|
Oops, something went wrong.