Only load lightgallery and mermaid on relevant pages
This commit is contained in:
parent
5b46a7e442
commit
cfa3c5f66f
4 changed files with 23 additions and 5 deletions
|
@ -13,6 +13,10 @@
|
|||
{{ partial "style.html" "css/font-awesome.min.css" }}
|
||||
{{ partial "style.html" "css/highlight.css" }}
|
||||
|
||||
{{ if eq .Params.layout "flickr" }}
|
||||
{{ partial "style.html" "css/lightgallery.min.css" }}
|
||||
{{ end }}
|
||||
|
||||
<title>{{ partial "title-item.html" . }}{{ .Site.Title }}</title>
|
||||
|
||||
{{ partial "metadata.html" . }}
|
||||
|
@ -28,10 +32,24 @@
|
|||
|
||||
{{ partial "footer.html" . }}
|
||||
|
||||
{{ $raw_content := "" }}
|
||||
|
||||
{{ if .Content }}
|
||||
{{ $raw_content = .RawContent }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "script.html" "js/jquery.js" }}
|
||||
|
||||
{{ if eq .Params.layout "flickr" }}
|
||||
{{ partial "script_async.html" "js/lightgallery.js" }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "script_async.html" "js/bootstrap.js" }}
|
||||
|
||||
{{ if in $raw_content "{{<mermaid" }}
|
||||
{{ partial "script_async.html" "js/mermaid.js" }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "script_async.html" "js/app.js" }}
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -12,6 +12,7 @@ cp -r $BASEDIR/node_modules/lightgallery/dist/fonts $STATIC_BUILD
|
|||
cp -r $STATIC_SRC/img $STATIC_BUILD/img
|
||||
cp -r $BASEDIR/node_modules/lightgallery/dist/img/* $STATIC_BUILD/img
|
||||
cp -r $BASEDIR/node_modules/@fortawesome/fontawesome-free/css/all.min.css $STATIC_BUILD/css/font-awesome.min.css
|
||||
cp $BASEDIR/node_modules/lightgallery/dist/css/lightgallery.min.css $STATIC_BUILD/css/lightgallery.min.css
|
||||
cp -r $BASEDIR/node_modules/@fortawesome/fontawesome-free/webfonts $STATIC_BUILD
|
||||
|
||||
cp $BASEDIR/node_modules/jquery/dist/jquery.min.js $STATIC_BUILD/js/jquery.js
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
@import "variables";
|
||||
|
||||
@import "node_modules/lightgallery/src/sass/lightgallery";
|
||||
@import "node_modules/bootstrap/scss/bootstrap";
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue