diff options
author | Benedikt T <datacobra@thinkbot.de> | 2021-07-07 13:06:19 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-07 13:06:19 +0300 |
commit | 9fb21459005c616064d1e8f7085e4d547e60798b (patch) | |
tree | 8092e6d17bc1328684a9938616a465c1e270bab9 | |
parent | bd44c15752f50c16be0d786b5f1f0cca25621cf1 (diff) | |
parent | ab85b865392aea7b1ce632b33323c6045302416d (diff) |
Merge branch 'master' into master
-rw-r--r-- | CONTRIBUTORS.md | 3 | ||||
-rw-r--r-- | exampleSite/config.toml | 25 | ||||
-rw-r--r-- | features.txt | 10 | ||||
-rw-r--r-- | layouts/partials/head.html | 16 |
4 files changed, 47 insertions, 7 deletions
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 74168c3..ffc98d6 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -14,4 +14,5 @@ collaboration of others. * [Bernardo Ayala](https://github.com/nardoyala) * [Mattia Panzeri](https://github.com/panz3r) * [Jörg Thalheim](https://github.com/Mic92) -* [Sarath Chandra Mekala](https://github.com/sarathmekala) +* [David Kaufmann](https://github.com/davidkaufmann) +* [Sarath Chandra Mekala](https://github.com/sarathmekala)
\ No newline at end of file diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 4148c43..51d316f 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -49,7 +49,7 @@ googleAnalytics = "" #favicon = true # Add list of sections that should show up on the homepage - mainSections = ["post"] + mainSections = ["post"] # Add list of Sections/Types that should no be considered by RSS #nofeedSections = ["post"] @@ -59,16 +59,35 @@ googleAnalytics = "" # Custom CSS applied to default styles. (Path could be "static/css/") #customCSS = "css/custom.css" - + # Show reading time on a post readingTime = false # Show word count on a post - wordCount = false + wordCount = false # Show author on a post (groups with readingTime and wordCount) hideAuthorOnPost = true +# Custom JavaScript +[params.customJS] +# enable Javascript by setting to true +#enabled = true +# add a filepath (could be "static/js/") +#src = "js/main.js" +# specifies which referrer information to send when fetching the script +#referrerpolicy = "no-referrer" +# specifies that the script should not be executed in browsers supporting ES2015 modules +#nomodule = false +# Allows a browser to check for integrity to ensure the code hasn't been manipulated +#integrity= "" +# execute the script when page has finished parsing (external only) +#defer = true +# sets the mode of the request to an http cors request +#crossorigin=true +# executes the script asynchronously (external only) +#async = true + # Comments [params.comments] # Enable Comments with "true" diff --git a/features.txt b/features.txt index e5e50be..8d7ca82 100644 --- a/features.txt +++ b/features.txt @@ -2,7 +2,15 @@ .Site.Params.keywords # Add meta keywords in head part (Site Keywords or Tags of Page) .Site.Params.description # Add meta description in head part (Site Description or Description of Page) .Site.Params.math # Add math typesetting with KaTeX (Global with this param) -.Site.Params.customcss # Add path to customcss you want to add to the theme +.Site.Params.customCSS # Add path to customCSS you want to add to the theme +.Site.Params.customJS.enabled # Enable/Disable customJS +.Site.Params.customJS.src # add the source path +.Site.Params.customJS.referrerpolicy # specifies which referrer information to send when fetching the script +.Site.Params.customJS.nomodule # specifies that the script should not be executed in browsers supporting ES2015 modules +.Site.Params.customJS.integrity # allows a browser to check for integrity to ensure the code hasn't been manipulated +.Site.Params.customJS.defer # execute the script when page has finished parsing (external only) +.Site.Params.customJS.crossorigin # sets the mode of the request to an http cors request +.Site.Params.customJS.async # executes the script asynchronously (external only) .Site.Params.pagetitle # Add pagetitle to homepage <title> tag .Site.Params.avatar # Add a avatar to your website .Site.Params.subtitle # Add a subtitle to your website diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 8201a85..682a1ab 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -53,8 +53,20 @@ }); </script> {{- end -}} - <!-- Use customcss if you like --> - {{- if isset .Site.Params "customcss" -}} + <!-- Use customJS if you like --> + {{- if .Site.Params.customJS.enabled -}} + <script + {{ if eq .Site.Params.customJS.async true }} {{ "async" | safeHTMLAttr}}{{ end }} + {{ if eq .Site.Params.customJS.defer true }} {{ "defer" | safeHTMLAttr}}{{ end }} + {{ if eq .Site.Params.customJS.nomodule true }} {{ "nomodule" | safeHTMLAttr}}{{ end }} + {{ if isset .Site.Params.customJS "crossorigin" }} {{ printf "crossorigin=%q" .Site.Params.customJs.crossorigin | safeHTMLAttr }}{{ end }} + {{ if isset .Site.Params.customJS "integrity" }} {{ printf "integrity=%q" .Site.Params.customJs.integrity | safeHTMLAttr }}{{ end }} + {{ if isset .Site.Params.customJS "referrerpolicy" }} {{ printf "referrerpolicy=%q" .Site.Params.customJs.referrerpolicy | safeHTMLAttr }}{{ end }} + {{ printf "src=%q" (.Site.Params.customJS.src | relURL) | safeHTMLAttr }}> + </script> + {{- end -}} + <!-- Use customCSS if you like --> + {{- if isset .Site.Params "customCSS" -}} <link rel="stylesheet" type="text/css" media="screen" href="{{ relURL .Site.Params.customCSS }}" /> {{- end -}} <!-- Use a SEO friendly title tag--> |