This commit is contained in:
zzossig 2019-11-05 17:22:56 +09:00
parent 68dcd09364
commit 4f2bdfee5f
6 changed files with 11 additions and 13 deletions

View File

@ -1,2 +0,0 @@
/*! Fetch Inject v2.0.4 | Copyright (C) Josh Habdas <jhabdas@protonmail.com> (https://habd.as) | @license Zlib */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).fetchInject=t()}(this,function(){"use strict";const e=function(e,t,n,r,o,c,i){c=t.createElement(n),i=t.getElementsByTagName(n)[0],c.appendChild(t.createTextNode(r.text)),c.onload=o(r),i?i.parentNode.insertBefore(c,i):t.head.appendChild(c)};return function(t,n){if(!arguments.length)return Promise.reject(new ReferenceError("Failed to execute 'fetchInject': 1 argument required but only 0 present."));if(arguments[0]&&arguments[0].constructor!==Array)return Promise.reject(new TypeError("Failed to execute 'fetchInject': argument 1 must be of type 'Array'."));if(arguments[1]&&arguments[1].constructor!==Promise)return Promise.reject(new TypeError("Failed to execute 'fetchInject': argument 2 must be of type 'Promise'."));const r=[],o=n?[].concat(n):[],c=[];return t.forEach(e=>o.push(window.fetch(e).then(e=>[e.clone().text(),e.blob()]).then(e=>Promise.all(e).then(e=>{r.push({text:e[0],blob:e[1]})})))),Promise.all(o).then(()=>(r.forEach(t=>{c.push({then:n=>{t.blob.type.includes("text/css")?e(window,document,"style",t,n):e(window,document,"script",t,n)}})}),Promise.all(c)))}});

View File

@ -16,15 +16,15 @@
{{ if $params.featured_image }} {{ if $params.featured_image }}
<div class="summary__image-wrapper"> <div class="summary__image-wrapper">
{{ with (print "/images/" $params.featured_image) }} {{ with (print "/images/" $params.featured_image) }}
<img data-src="{{ . | absURL }}" alt="{{ print $params.featured_image }}" class="lazyload summary__image"> <img data-src="{{ . | relURL }}" alt="{{ print $params.featured_image }}" class="lazyload summary__image">
{{ end }} {{ end }}
</div> </div>
{{ else if $params.featured_video }} {{ else if $params.featured_video }}
{{ with (print "/videos/poster/" $params.featured_video_poster) }} {{ with (print "/videos/poster/" $params.featured_video_poster) }}
<div class="video"> <div class="video">
<video class='video-js' controls preload='none' poster='{{ . | absURL }}' data-setup='{"fluid": true}'> <video class='video-js' controls preload='none' poster='{{ . | relURL }}' data-setup='{"fluid": true}'>
{{ with (print "/videos/" $params.featured_video) }} {{ with (print "/videos/" $params.featured_video) }}
<source src="{{ . | absURL }}" type='video/mp4'> <source src="{{ . | relURL }}" type='video/mp4'>
{{ end }} {{ end }}
<p class='vjs-no-js'> <p class='vjs-no-js'>
To view this video please enable JavaScript, and consider upgrading to a web browser that To view this video please enable JavaScript, and consider upgrading to a web browser that

View File

@ -11,7 +11,7 @@
{{ $basename := (replace .File.Dir "\\" "/") }} {{ $basename := (replace .File.Dir "\\" "/") }}
{{ range (readDir (print "./static/" $basename)) }} {{ range (readDir (print "./static/" $basename)) }}
<div class="grid-item"> <div class="grid-item">
<img data-src="{{ $basename | absURL }}{{ .Name }}" alt="{{ .Name }}" class="lazyload"> <img data-src="{{ $basename | relURL }}{{ .Name }}" alt="{{ .Name }}" class="lazyload">
</div> </div>
{{ end }} {{ end }}
</div> </div>

View File

@ -1,9 +1,9 @@
{{ if $.Param "enableCustomScrollbar" }} {{ if $.Param "enableCustomScrollbar" }}
{{ $customscrollbar := resources.Get `js/perfect-scrollbar.jquery.min.js` | fingerprint }} {{ $customscrollbar := resources.Get `js/perfect-scrollbar.jquery.min.js` | fingerprint }}
<script defer src="{{ $customscrollbar.RelPermalink }}"></script> <script src="{{ $customscrollbar.RelPermalink }}"></script>
{{ $customScrollbarStyle := resources.Get "css/perfect-scrollbar.min.css" }} {{ $customScrollbarStyle := resources.Get "css/perfect-scrollbar.min.css" }}
<script defer src="{{ $customScrollbarStyle.RelPermalink }}"></script> <script src="{{ $customScrollbarStyle.RelPermalink }}"></script>
<script> <script>
var pre = $('pre'); var pre = $('pre');

View File

@ -68,13 +68,13 @@
</div> </div>
{{ $photoSwipe := resources.Get `js/photoswipe.min.js` | fingerprint }} {{ $photoSwipe := resources.Get `js/photoswipe.min.js` | fingerprint }}
<script defer src="{{ $photoSwipe.RelPermalink }}"></script> <script src="{{ $photoSwipe.RelPermalink }}"></script>
{{ $photoSwipeUi := resources.Get `js/photoswipe-ui-default.min.js` | fingerprint }} {{ $photoSwipeUi := resources.Get `js/photoswipe-ui-default.min.js` | fingerprint }}
<script defer src="{{ $photoSwipeUi.RelPermalink }}"></script> <script src="{{ $photoSwipeUi.RelPermalink }}"></script>
{{ $photoSwipeStyle := resources.Get "css/photoswipe/photoswipe.css" }} {{ $photoSwipeStyle := resources.Get "css/photoswipe/photoswipe.css" }}
<script defer src="{{ $photoSwipeStyle.RelPermalink }}"></script> <script src="{{ $photoSwipeStyle.RelPermalink }}"></script>
{{ $photoSwipeSkin := resources.Get "css/photoswipe/custom-skin.css" }} {{ $photoSwipeSkin := resources.Get "css/photoswipe/custom-skin.css" }}
<script defer src="{{ $photoSwipeSkin.RelPermalink }}"></script> <script src="{{ $photoSwipeSkin.RelPermalink }}"></script>
<script> <script>
var pswpElement = $('.pswp')[0]; var pswpElement = $('.pswp')[0];

View File

@ -8,7 +8,7 @@
</div> </div>
{{ $toc := resources.Get `js/jquery.toc.min.js` | fingerprint }} {{ $toc := resources.Get `js/jquery.toc.min.js` | fingerprint }}
<script defer src="{{ $toc.RelPermalink }}"></script> <script src="{{ $toc.RelPermalink }}"></script>
<script> <script>
var navbar = $('.navbar'); var navbar = $('.navbar');