custom style, js file support
This commit is contained in:
parent
99c40c5971
commit
2d6e0c2bca
|
@ -12,6 +12,10 @@ $(document).ready(function() {
|
||||||
|
|
||||||
var scroll = $(window).scrollTop();
|
var scroll = $(window).scrollTop();
|
||||||
if (scroll > position) { // scroll down
|
if (scroll > position) { // scroll down
|
||||||
|
if (scroll < 45) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (!navbar.hasClass('navbar--hide')) {
|
if (!navbar.hasClass('navbar--hide')) {
|
||||||
navbar.addClass('navbar--hide');
|
navbar.addClass('navbar--hide');
|
||||||
} else if (navbar.hasClass('navbar--show')) {
|
} else if (navbar.hasClass('navbar--show')) {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<script defer src="{{ $clipboard.RelPermalink }}"></script>
|
<script defer src="{{ $clipboard.RelPermalink }}"></script>
|
||||||
{{ $enquire := resources.Get "js/enquire.min.js" | resources.Fingerprint }}
|
{{ $enquire := resources.Get "js/enquire.min.js" | resources.Fingerprint }}
|
||||||
<script defer src="{{ $enquire.RelPermalink }}"></script>
|
<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>
|
<script defer src="{{ $prism.RelPermalink }}"></script>
|
||||||
{{ $lunr := resources.Get "js/lunr.min.js" | resources.Fingerprint }}
|
{{ $lunr := resources.Get "js/lunr.min.js" | resources.Fingerprint }}
|
||||||
<script defer src="{{ $lunr.RelPermalink }}"></script>
|
<script defer src="{{ $lunr.RelPermalink }}"></script>
|
||||||
|
@ -12,5 +12,13 @@
|
||||||
<script defer src="{{ $lazysizes.RelPermalink }}"></script>
|
<script defer src="{{ $lazysizes.RelPermalink }}"></script>
|
||||||
{{ $shave := resources.Get "js/jquery.shave.min.js" | resources.Fingerprint }}
|
{{ $shave := resources.Get "js/jquery.shave.min.js" | resources.Fingerprint }}
|
||||||
<script defer src="{{ $shave.RelPermalink }}"></script>
|
<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>
|
<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 }}
|
|
@ -1,8 +1,12 @@
|
||||||
{{ $main_options := (dict "targetPath" "css/zzo.css" "outputStyle" "compressed") }}
|
{{ $main_options := (dict "targetPath" "css/zzo.css" "outputStyle" "compressed") }}
|
||||||
{{ $main_template := resources.Get "sass/main.scss" }}
|
{{ $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 }}">
|
<link rel="stylesheet" href="{{ $main_style.RelPermalink }}">
|
||||||
|
|
||||||
{{ range .Site.Params.custom_css -}}
|
{{ 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 }}
|
{{- end }}
|
Loading…
Reference in New Issue