diff --git a/static/js/dom-scripts.js b/assets/js/template-dom-scripts.js similarity index 98% rename from static/js/dom-scripts.js rename to assets/js/template-dom-scripts.js index 5128836..a09330d 100644 --- a/static/js/dom-scripts.js +++ b/assets/js/template-dom-scripts.js @@ -130,4 +130,8 @@ } } }); + + {{ if .Site.Params.darkThemeAsDefault }} + darkTheme('screen'); + {{ end }} }()); diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index ae46486..d1e2b2f 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -24,6 +24,7 @@ params: dateFormat: Jan 2, 2006 codePenUser: someUser katex: true + darkThemeAsDefault: false # A list of custom css files can be provided, which must be placed inside # 'static/'. # This is useful to override just specific css classes, instead of copying diff --git a/layouts/partials/script.html b/layouts/partials/script.html index f8d831f..95ebeb2 100644 --- a/layouts/partials/script.html +++ b/layouts/partials/script.html @@ -1,2 +1,5 @@ - + +{{ $templateDomScripts := resources.Get "js/template-dom-scripts.js" }} +{{ $domScripts := $templateDomScripts | resources.ExecuteAsTemplate "js/dom-scripts.js" . }} +