feat: add more defaults to Wowchemy's config.toml

Also, disable HighlightJS and Netlify Identity by default to optimize performance.

Hugo restricts a module's own config file to only defining params, menu, outputformats, and mediatypes: https://gohugo.io/hugo-modules/theme-components/ . Lets define outputformats, and mediatypes directly in the module so there's one less thing for a user to add to their site's config file.
This commit is contained in:
George Cushen committed 2020-10-26 22:32:20 +00:00
1 parent a4c1a37e8b
commit 5d827c258a
5 files changed
+21 -11

No files matched your search

-5
View File
@@ -1,5 +0,0 @@
[module]
[module.hugoVersion]
# This version of Wowchemy is compatible with the following Hugo versions:
min = "0.73.0"
extended = true
+15
View File
@@ -0,0 +1,15 @@
mediaTypes:
application/manifest+json:
suffixes:
- webmanifest
outputFormats:
WebAppManifest:
mediaType: application/manifest+json
rel: manifest
module:
hugoVersion:
min: '0.73.0'
extended: true
params:
theme: minimal
font: native
+1 -1
View File
@@ -2,7 +2,7 @@
{
"name": "{{site.Title}}",
"short_name": "{{site.Title}}",
"lang": "{{site.LanguageCode}}",
"lang": "{{ site.LanguageCode | default "en-us" }}",
"theme_color": "{{ $scr.Get "primary" }}",
"background_color": "{{ $scr.Get "primary" }}",
"icons": [{
+3 -3
View File
@@ -80,9 +80,9 @@
{{ printf "<link rel=\"stylesheet\" href=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\">" (printf $css.fontAwesome.url $css.fontAwesome.version) $css.fontAwesome.sri | safeHTML }}
{{ printf "<link rel=\"stylesheet\" href=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\">" (printf $css.fancybox.url $css.fancybox.version) $css.fancybox.sri | safeHTML }}
{{/* Default to enabling highlighting, but allow the user to override it in .Params or site.Params.
{{/* Default to disabling highlighting, but allow the user to override it in .Params or site.Params.
Use $scr to store "highlight_enabled", so that we can read it again in footer.html. */}}
{{ $scr.Set "highlight_enabled" true }}
{{ $scr.Set "highlight_enabled" false }}
{{ if isset .Params "highlight" }}
{{ $scr.Set "highlight_enabled" .Params.highlight }}
{{ else if isset site.Params "highlight" }}
@@ -160,7 +160,7 @@
{{ partial "marketing/google_tag_manager" . }}
{{/* Netlify Identity integration. */}}
{{ if .IsHome | and (site.Params.cms.netlify_cms | default true) }}
{{ if .IsHome | and (site.Params.cms.netlify_cms | default false) }}
<script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
{{ end }}
+2 -2
View File
@@ -2,5 +2,5 @@ title: Wowchemy Test
module:
imports:
- path: github.com/wowchemy/wowchemy-hugo-modules/wowchemy
params:
theme: minimal
outputs:
home: [HTML, RSS, JSON, WebAppManifest]