mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-18 05:41:31 +00:00
Combine local JS.
’yui-compressor’ is no longer used.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
<p class="font-italic text-muted small">Comments powered by <a href="https://disqus.com/">Disqus</a>.</p>
|
||||
</div>
|
||||
|
||||
<script src="{{ site.baseurl }}/assets/lib/jquery.disqusloader.min.js"></script>
|
||||
<script src="{{ site.baseurl }}/assets/js/lib/jquery.disqusloader.min.js"></script>
|
||||
<script>
|
||||
var options = {
|
||||
scriptUrl: '//{{ site.disqus.shortname }}.disqus.com/embed.js',
|
||||
|
||||
@@ -11,22 +11,21 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<title>
|
||||
{%- if page.layout == "home" -%}
|
||||
{{- site.title -}}
|
||||
{%- else -%}
|
||||
{{ page.title }} | {{ site.title }}
|
||||
{%- endif -%}
|
||||
{%- unless page.layout == "home" -%}
|
||||
{{ page.title | append: " | "}}
|
||||
{%- endunless -%}
|
||||
{{ site.title }}
|
||||
</title>
|
||||
|
||||
{% seo title=false %}
|
||||
|
||||
{% include favicons.html %}
|
||||
|
||||
<!-- google fonts -->
|
||||
<!-- Google Fonts -->
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous">
|
||||
<link rel="dns-prefetch" href="https://fonts.gstatic.com">
|
||||
|
||||
<!-- ga -->
|
||||
<!-- GA -->
|
||||
{% if jekyll.environment == 'production' %}
|
||||
<link rel="preconnect" href="https://www.google-analytics.com" crossorigin="use-credentials">
|
||||
<link rel="dns-prefetch" href="https://www.google-analytics.com">
|
||||
@@ -40,10 +39,12 @@
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<!-- jsdelivr CDN -->
|
||||
<!-- jsDelivr CDN -->
|
||||
<link rel="preconnect" href="cdn.jsdelivr.net">
|
||||
<link rel="dns-prefetch" href="cdn.jsdelivr.net">
|
||||
|
||||
<!-- Bootstrap -->
|
||||
|
||||
<link rel="preload" as="style"
|
||||
href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css"
|
||||
integrity="sha256-LA89z+k9fjgMKQ/kq4OO2Mrf8VltYml/VES+Rg0fh20=" crossorigin>
|
||||
@@ -52,6 +53,8 @@
|
||||
href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css"
|
||||
integrity="sha256-LA89z+k9fjgMKQ/kq4OO2Mrf8VltYml/VES+Rg0fh20=" crossorigin="anonymous">
|
||||
|
||||
<!-- Font Awesome -->
|
||||
|
||||
<link rel="preload" as="style"
|
||||
href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.11.2/css/all.min.css"
|
||||
integrity="sha256-+N4/V/SbAFiW1MPBCXnfnP9QSN3+Keu+NlB+0ev/YKQ="
|
||||
@@ -100,41 +103,18 @@
|
||||
<link rel="stylesheet" href="{{ site.baseurl }}/assets/lib/bootstrap-toc-1.0.1/bootstrap-toc.min.css" />
|
||||
{% endif %}
|
||||
|
||||
{% if page.math %}
|
||||
<!-- MathJax -->
|
||||
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" async></script>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
<link rel="preload" as="script"
|
||||
href="https://cdn.jsdelivr.net/combine/npm/jquery@3.4.1,npm/popper.js@1.15.0,npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" crossorigin>
|
||||
<!-- JavaScripts -->
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/combine/npm/jquery@3.4.1,npm/popper.js@1.15.0,npm/bootstrap@4.0.0/dist/js/bootstrap.min.js"></script>
|
||||
<link rel="preload" as="script" href="https://cdn.jsdelivr.net/npm/jquery@3.4.1"
|
||||
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous">
|
||||
|
||||
<script src="{{ site.baseurl }}/assets/js/dist/commons.js" async></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1"
|
||||
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
|
||||
|
||||
{% if page.layout == 'home' or page.layout == 'post' %}
|
||||
<script src="{{ site.baseurl }}/assets/js/dist/timeago.min.js" async></script>
|
||||
{% if site.google_analytics.pv.enabled %}
|
||||
<script src="{{ site.baseurl }}/assets/data/pv-data.json"></script>
|
||||
<script src="{{ site.baseurl }}/assets/lib/countUp.min.js" async></script>
|
||||
<script src="{{ site.baseurl }}/assets/js/dist/pageviews.min.js" async></script>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<script src="https://cdn.jsdelivr.net/combine/npm/popper.js@1.15.0,npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" async></script>
|
||||
|
||||
{% if site.toc and page.toc and page.layout == 'post' %}
|
||||
<link rel="preload" as="script" href="{{ site.baseurl }}/assets/lib/bootstrap-toc-1.0.1/bootstrap-toc.min.js">
|
||||
<script src="{{ site.baseurl }}/assets/lib/bootstrap-toc-1.0.1/bootstrap-toc.min.js" async></script>
|
||||
<script src="{{ site.baseurl }}/assets/js/dist/toc.min.js" async></script>
|
||||
{% endif %}
|
||||
|
||||
<script src="{{ site.baseurl }}/assets/js/dist/tooltip-loader.min.js" async></script>
|
||||
|
||||
<!-- PWA -->
|
||||
{% if jekyll.environment == 'production' %}
|
||||
<script src="{{ '/app.js' | relative_url }}" defer></script>
|
||||
{% endif %}
|
||||
{% include js-selector.html %}
|
||||
|
||||
</head>
|
||||
45
_includes/js-selector.html
Normal file
45
_includes/js-selector.html
Normal file
@@ -0,0 +1,45 @@
|
||||
<!--
|
||||
JS selector for site.
|
||||
Chirpy v2.3
|
||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
© 2020 Cotes Chung
|
||||
MIT Licensed
|
||||
-->
|
||||
|
||||
{% if page.layout == 'home' %}
|
||||
|
||||
<script src="{{ '/assets/js/home.min.js' | relative_url }}" async></script>
|
||||
|
||||
{% elsif page.layout == 'post' %}
|
||||
|
||||
{% if site.toc and page.toc %}
|
||||
<script src="{{ '/assets/js/post-toc.min.js' | relative_url }}" async></script>
|
||||
{% else %}
|
||||
<script src="{{ '/assets/js/post.min.js' | relative_url }}" async></script>
|
||||
{% endif %}
|
||||
|
||||
{% if page.math %}
|
||||
<!-- MathJax -->
|
||||
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" async></script>
|
||||
{% endif %}
|
||||
|
||||
{% elsif page.layout == 'page' %}
|
||||
|
||||
{% if page.title == 'Categories' %}
|
||||
<script src="{{ '/assets/js/categories.min.js' | relative_url }}" async></script>
|
||||
{% else %}
|
||||
<script src="{{ '/assets/js/page.min.js' | relative_url }}" async></script>
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
|
||||
<script src="{{ '/assets/js/page.min.js' | relative_url }}" async></script>
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
||||
<!-- PWA -->
|
||||
{% if jekyll.environment == 'production' %}
|
||||
<script src="{{ '/app.js' | relative_url }}" defer></script>
|
||||
{% endif %}
|
||||
@@ -5,7 +5,6 @@
|
||||
© 2017-2019 Cotes Chung
|
||||
MIT License
|
||||
-->
|
||||
<script src="https://cdn.jsdelivr.net/npm/simple-jekyll-search@1.7.3/dest/simple-jekyll-search.min.js" integrity="sha256-qcLR00zq6pJk4je3MLgAri8Nn+ZumUlXgTKR2H/xCY0=" crossorigin="anonymous"></script>
|
||||
|
||||
{% capture result_elem %}
|
||||
<div class="pl-1 pr-1 pl-sm-2 pr-sm-2 pl-lg-4 pr-lg-4 pl-xl-0 pr-xl-0">
|
||||
@@ -20,11 +19,13 @@
|
||||
|
||||
{% capture not_found %}<p class="mt-5">Oops! No result founds.</p>{% endcapture %}
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/simple-jekyll-search@1.7.3/dest/simple-jekyll-search.min.js"></script>
|
||||
|
||||
<script>
|
||||
SimpleJekyllSearch({
|
||||
searchInput: document.getElementById('search-input'),
|
||||
resultsContainer: document.getElementById('search-results'),
|
||||
json: '{{ site.baseurl }}/assets/data/search.json',
|
||||
json: '{{ site.baseurl }}/assets/js/data/search.json',
|
||||
searchResultTemplate: '{{ result_elem | strip_newlines }}',
|
||||
noResultsText: '{{ not_found }}'
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user