mirror of https://github.com/onweru/compose.git

weru
12.33.2021 0cfdc6ed6251a98792fc5bc8a3828a0b1479605f
enable custom assets #38
2 files modified
2 files added
20 ■■■■■ changed files
layouts/partials/head.html 9 ●●●● patch | view | raw | blame | history
layouts/partials/hooks/head.html 1 ●●●● patch | view | raw | blame | history
layouts/partials/hooks/scripts.html 1 ●●●● patch | view | raw | blame | history
layouts/partials/scripts.html 9 ●●●●● patch | view | raw | blame | history
layouts/partials/head.html
@@ -23,6 +23,12 @@
<link rel="stylesheet" href="{{ $styles.Permalink }}" integrity="{{ $styles.Data.Integrity }}">
{{- $sp := .Site.Params }}
{{- with $sp.customCSS }}
  {{- range . -}}
  <link rel="stylesheet" href="{{ . }}">
  {{- end }}
{{- end }}
{{ with $sp.metaThemeColor }}
  <meta name="theme-color" content="{{.}}">
{{ end }}
@@ -33,4 +39,5 @@
  <meta name="description" content="{{ .Summary | plainify }}">
{{ else if .Site.Params.Description }}
  <meta name="descripion" content="{{.Site.Params.Description }}">
{{ end }}
{{ end }}
{{- partialCached "hooks/head" . }}
layouts/partials/hooks/head.html
New file
@@ -0,0 +1 @@
<!-- custom styles, preload scripts, custom meta tags -->
layouts/partials/hooks/scripts.html
New file
@@ -0,0 +1 @@
<!-- custom scripts -->
layouts/partials/scripts.html
@@ -18,3 +18,12 @@
{{- $bundle := slice $variables $functions $code $main $fuse $search | resources.Concat "js/bundle.js" | resources.Minify | resources.Fingerprint "sha512" }}
<script src="{{ $bundle.Permalink }}"></script>
{{- partialCached "hooks/scripts" . -}}
{{- $sp := .Site.Params }}
{{- with $sp.customJS }}
  {{- range . -}}
    <script src="{{ . }}"></script>
  {{- end }}
{{- end -}}