Move all layouts to platters theme
This commit is contained in:
parent
de8101efed
commit
66adceaf24
91 changed files with 0 additions and 0 deletions
30
themes/platters/layouts/partials/resources/importmap.html
Normal file
30
themes/platters/layouts/partials/resources/importmap.html
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{{ $imports := dict }}
|
||||
|
||||
{{ if eq 0 1 }}
|
||||
{{ with $tsModuleResources := resources.Match "scripts/modules/*/*" }}
|
||||
{{ range $tsModuleResources }}
|
||||
{{ $resource := . }}
|
||||
{{ if eq (path.Ext .) ".ts" }}
|
||||
{{ $resource = . | js.Build }}
|
||||
{{ end }}
|
||||
|
||||
{{/*
|
||||
Create imports for these scripts that look like $dirname/$basename
|
||||
where basename doesn't have the extension
|
||||
*/}}
|
||||
{{ $directoryBasename := path.Base (path.Dir $resource) }}
|
||||
{{ $key := path.Join $directoryBasename (path.BaseName $resource) }}
|
||||
|
||||
{{ $imports = merge $imports (dict $key $resource.RelPermalink) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ $imports = dict "modules/" "scripts/modules/" }}
|
||||
{{ end }}
|
||||
|
||||
{{ $importmap := dict }}
|
||||
{{ if gt (len $imports) 0 }}
|
||||
{{ $importmap = dict "imports" $imports }}
|
||||
{{ end }}
|
||||
|
||||
{{ return $importmap }}
|
||||
36
themes/platters/layouts/partials/resources/page_css.html
Normal file
36
themes/platters/layouts/partials/resources/page_css.html
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{{ $stylesheets := slice }}
|
||||
{{ with .Resources.Match "*.css" }}
|
||||
{{ range . }}
|
||||
{{ $stylesheets = $stylesheets | append . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if eq .Kind "home" }}
|
||||
{{ with resources.Get "styles/home.css" }}
|
||||
{{ $stylesheets = $stylesheets | append . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $processedStylesheets := slice }}
|
||||
{{ range $stylesheets }}
|
||||
{{ $processedStylesheets = $processedStylesheets | append (. | resources.ExecuteAsTemplate .Name .) }}
|
||||
{{ end }}
|
||||
|
||||
{{ if hugo.IsProduction }}
|
||||
{{/*
|
||||
Replace the list of stylesheets that helps with debugging with a
|
||||
concatenated and fingerprinted version.
|
||||
*/}}
|
||||
{{ if gt (len $processedStylesheets) 0 }}
|
||||
{{ with $file := $.File }}
|
||||
{{ $outputFilename := printf "%s/page.css" $.File.Dir }}
|
||||
{{ $processedStylesheets = slice ($processedStylesheets
|
||||
| resources.Concat $outputFilename
|
||||
| fingerprint "md5") }}
|
||||
{{ else }}
|
||||
{{ warnf "No File for page CSS." }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ return $processedStylesheets }}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{{- $railroadUtilsJS := resources.Get "scripts/railroad-utils.js"
|
||||
| js.Build
|
||||
| resources.Fingerprint "md5" -}}
|
||||
{{ return $railroadUtilsJS }}
|
||||
19
themes/platters/layouts/partials/resources/root_css.html
Normal file
19
themes/platters/layouts/partials/resources/root_css.html
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{{ $stylesheets := slice (resources.Get "styles/railroad.css")
|
||||
(resources.Get "styles/monokai.css")
|
||||
| append (resources.Match "styles/root/*.css" | sort) }}
|
||||
{{ if not hugo.IsProduction }}
|
||||
{{ $stylesheets = $stylesheets | append (resources.Get "styles/development.css") }}
|
||||
{{ end }}
|
||||
|
||||
{{ $rootStylesheets := slice }}
|
||||
{{ range $stylesheets }}
|
||||
{{ $rootStylesheets = $rootStylesheets | append (. | resources.ExecuteAsTemplate .Name .) }}
|
||||
{{ end }}
|
||||
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ $rootStylesheets = slice ($rootStylesheets
|
||||
| resources.Concat "styles/root.css"
|
||||
| fingerprint "md5") }}
|
||||
{{ end }}
|
||||
|
||||
{{ return $rootStylesheets }}
|
||||
2
themes/platters/layouts/partials/resources/script.html
Normal file
2
themes/platters/layouts/partials/resources/script.html
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
{{ $script := resources.Get (printf "scripts/%s.js" .) | fingerprint "md5" }}
|
||||
{{ return $script }}
|
||||
28
themes/platters/layouts/partials/resources/section_css.html
Normal file
28
themes/platters/layouts/partials/resources/section_css.html
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{{ $stylesheetName := printf "styles/%s.css" .Section }}
|
||||
|
||||
{{ $stylesheets := slice }}
|
||||
{{ if gt (len .Section) 0 }}
|
||||
{{ with resources.Match (printf "styles/%s/*" .Section) }}
|
||||
{{ $stylesheets = . }}
|
||||
{{ else }}
|
||||
{{ with resources.Get $stylesheetName }}
|
||||
{{ $stylesheets = (slice .) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $sectionStylesheets := slice }}
|
||||
{{ if $stylesheets }}
|
||||
{{ range $stylesheets }}
|
||||
{{ $sectionStylesheets = $sectionStylesheets | append (. | resources.ExecuteAsTemplate .Name .) }}
|
||||
{{ end }}
|
||||
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ $sectionStylesheets = slice ($sectionStylesheets
|
||||
| resources.Concat $stylesheetName
|
||||
| minify
|
||||
| fingerprint "md5") }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ return $sectionStylesheets }}
|
||||
2
themes/platters/layouts/partials/resources/site_js.html
Normal file
2
themes/platters/layouts/partials/resources/site_js.html
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
{{ $siteJS := resources.Get "scripts/site.js" | fingerprint "md5" }}
|
||||
{{ return $siteJS }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue