custom style, js file support

This commit is contained in:
zzossig 2019-11-07 01:47:35 +09:00
parent 99c40c5971
commit 2d6e0c2bca
3 changed files with 20 additions and 4 deletions

View File

@ -12,6 +12,10 @@ $(document).ready(function() {
var scroll = $(window).scrollTop();
if (scroll > position) { // scroll down
if (scroll < 45) {
return null;
}
if (!navbar.hasClass('navbar--hide')) {
navbar.addClass('navbar--hide');
} else if (navbar.hasClass('navbar--show')) {

View File

@ -4,7 +4,7 @@
<script defer src="{{ $clipboard.RelPermalink }}"></script>
{{ $enquire := resources.Get "js/enquire.min.js" | resources.Fingerprint }}
<script defer src="{{ $enquire.RelPermalink }}"></script>
{{ $prism := resources.Get "js/prism.min.js" | minify | resources.Fingerprint }}
{{ $prism := resources.Get "js/prism.min.js" | resources.Minify | resources.Fingerprint }}
<script defer src="{{ $prism.RelPermalink }}"></script>
{{ $lunr := resources.Get "js/lunr.min.js" | resources.Fingerprint }}
<script defer src="{{ $lunr.RelPermalink }}"></script>
@ -12,5 +12,13 @@
<script defer src="{{ $lazysizes.RelPermalink }}"></script>
{{ $shave := resources.Get "js/jquery.shave.min.js" | resources.Fingerprint }}
<script defer src="{{ $shave.RelPermalink }}"></script>
{{ $zzo := resources.Get "js/zzo.js" | minify | resources.Fingerprint }}
{{ $zzo := resources.Get "js/zzo.js" | resources.Minify | resources.Fingerprint }}
<script defer src="{{ $zzo.RelPermalink }}"></script>
{{ range .Site.Params.custom_js -}}
{{ $custom_template := resources.Get . }}
{{ if $custom_template }}
{{ $custom_js := $custom_template | resources.Minify | resources.Fingerprint }}
<script defer src="{{ $custom_js.RelPermalink }}"></script>
{{ end }}
{{- end }}

View File

@ -1,8 +1,12 @@
{{ $main_options := (dict "targetPath" "css/zzo.css" "outputStyle" "compressed") }}
{{ $main_template := resources.Get "sass/main.scss" }}
{{ $main_style := $main_template | resources.ExecuteAsTemplate "main_parsed.scss" . | toCSS $main_options | minify }}
{{ $main_style := $main_template | resources.ExecuteAsTemplate "main_parsed.scss" . | toCSS $main_options | resources.Minify }}
<link rel="stylesheet" href="{{ $main_style.RelPermalink }}">
{{ range .Site.Params.custom_css -}}
<link rel="stylesheet" href="{{ . | absURL }}">
{{ $custom_template := resources.Get . }}
{{ if $custom_template }}
{{ $custom_style := $custom_template | resources.ToCSS | resources.Minify }}
<link rel="stylesheet" href="{{ $custom_style.RelPermalink }}">
{{ end }}
{{- end }}