diff options
| author | anoduck <11767-anoduck@users.noreply.gitgud.io> | 2024-09-13 20:22:52 -0400 |
|---|---|---|
| committer | anoduck <11767-anoduck@users.noreply.gitgud.io> | 2024-09-13 20:23:11 -0400 |
| commit | 9744378a9b9071872182edb4f151f915ecfa8643 (patch) | |
| tree | a8c9b8de8e223f6edbecc91b899c2f2a196c712e /layouts/partials/InitModules.html | |
| parent | 5e0f93a81672bacbfd583cfe8cc40f24282af031 (diff) | |
added tags, working out themeing
Diffstat (limited to 'layouts/partials/InitModules.html')
| -rw-r--r-- | layouts/partials/InitModules.html | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/layouts/partials/InitModules.html b/layouts/partials/InitModules.html new file mode 100644 index 0000000..0241774 --- /dev/null +++ b/layouts/partials/InitModules.html @@ -0,0 +1,62 @@ +{{ $core := slice }} +{{ $optional := slice }} +{{ $excludeSCSS := slice }} +{{ $disableTemplate := slice }} +{{ $localize := slice }} +{{ $modules := dict }} + +{{ range $key, $mod := .Site.Params.modules }} + {{ if eq $key "core" }} + {{ warnf "DEPRECATED: module parameter `core` has been deprecated in release v0.24.0" }} + {{ $core = $core | append $mod }} + {{ else if eq $key "optional" }} + {{ warnf "DEPRECATED: module parameter `optional` has been deprecated in release v0.24.0" }} + {{ $optional = $optional | append $mod }} + {{ else if eq $key "excludescss" }} + {{ warnf "DEPRECATED: module parameter `excludeSCSS` has been deprecated in release v0.24.0" }} + {{ $excludeSCSS = $excludeSCSS | append $mod }} + {{ else if eq $key "disabletemplate" }} + {{ warnf "DEPRECATED: module parameter `disableTemplate` has been deprecated in release v0.24.0" }} + {{ $disableTemplate = $disableTemplate | append $mod }} + {{ else if reflect.IsMap $mod }} + {{ $integration := index $mod "integration" }} + {{ if eq $integration "core" }} + {{ $core = $core | append $key }} + {{ else if eq $integration "optional" }} + {{ $optional = $optional | append $key }} + {{ else if $integration }} + {{ warnf "Unrecognized module integration setting: %s" $integration }} + {{ end }} + + {{ if eq (index $mod "excludeSCSS") true }} + {{ $excludeSCSS = $excludeSCSS | append $key }} + {{ end }} + + {{ if eq (index $mod "disableTemplate") true }} + {{ $disableTemplate = $disableTemplate | append $key }} + {{ end }} + + {{ if eq (index $mod "localize") true }} + {{ $localize = $localize | append $key }} + {{ end }} + + {{ $modules = merge $modules (dict $key $mod) }} + {{ else }} + {{ warnf "Unsupported module parameter: %s" $key }} + {{ end }} +{{ end }} + +{{ $modules := dict + "modules" $modules + "core" $core + "optional" $optional + "excludeSCSS" $excludeSCSS + "disableTemplate" $disableTemplate + "localize" $localize +}} + +{{- if and .IsPage (not (in $core "bootstrap")) -}} + {{- errorf "Bootstrap is a required module, please add it to 'modules.core' in your site parameters" -}} +{{- end -}} + +{{ return $modules }}
\ No newline at end of file |
