theme: add migration layer #891

This commit is contained in:
Sören Weber 2024-09-11 20:22:53 +02:00
parent f490174e4b
commit c5db84c5db
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
19 changed files with 21 additions and 14 deletions

View file

@ -1,3 +1,3 @@
{{- $assetBusting := partialCached "_relearn/assetbusting.gotmpl" . -}}
{{- $assetBusting := partialCached "assetbusting.gotmpl" . -}}
@import "{{ printf "%s-%s.css%s" .prefix .light $assetBusting }}" screen and (prefers-color-scheme: light);
@import "{{ printf "%s-%s.css%s" .prefix .dark $assetBusting }}" screen and (prefers-color-scheme: dark);

View file

@ -1,4 +1,4 @@
{{- $assetBusting := partialCached "_relearn/assetbusting.gotmpl" . -}}
{{- $assetBusting := partialCached "assetbusting.gotmpl" . -}}
@import "{{ printf "theme-%s.css%s" .themevariant.identifier $assetBusting }}";
@import "{{ printf "chroma-%s.css%s" .themevariant.chroma $assetBusting }}";

View file

@ -1,2 +1,2 @@
{{- $assetBusting := partialCached "_relearn/assetbusting.gotmpl" . -}}
{{- $assetBusting := partialCached "assetbusting.gotmpl" . -}}
@import "{{ printf "format-print.css%s" $assetBusting }}";

View file

@ -1,4 +1,4 @@
{{- $assetBusting := partialCached "_relearn/assetbusting.gotmpl" . -}}
{{- $assetBusting := partialCached "assetbusting.gotmpl" . -}}
/* Styles to make Swagger-UI fit into our theme */
@import "{{ printf "fonts.css%s" $assetBusting }}";

View file

@ -1,4 +1,4 @@
{{- $assetBusting := partialCached "_relearn/assetbusting.gotmpl" . -}}
{{- $assetBusting := partialCached "assetbusting.gotmpl" . -}}
/* this file is here for compatiblity with older installations
use theme-relearn-light instead */
@import "{{ printf "theme-relearn-light.css%s" $assetBusting }}";

View file

@ -1,4 +1,4 @@
{{- $assetBusting := partialCached "_relearn/assetbusting.gotmpl" . }}
{{- $assetBusting := partialCached "assetbusting.gotmpl" . }}
<span class="github-buttons"></span>
<p>Built with <a href="https://github.com/McShelby/hugo-theme-relearn" title="love"><i class="fas fa-heart"></i></a> by <a href="https://gohugo.io/">Hugo</a></p>
<script>

View file

@ -73,7 +73,7 @@
{{- partial "custom-comments.html" . }}
</div>
{{- block "menu" . }}{{ end }}
{{- $assetBusting := partialCached "_relearn/assetbusting.gotmpl" . }}
{{- $assetBusting := partialCached "assetbusting.gotmpl" . }}
<script src="{{"js/clipboard.min.js" | relURL}}{{ $assetBusting }}" defer></script>
<script src="{{"js/perfect-scrollbar.min.js" | relURL}}{{ $assetBusting }}" defer></script>
{{- partial "dependencies.html" (dict "page" . "location" "footer") }}

View file

@ -125,7 +125,7 @@ Chroma auto run:
{{- end }}
{{- with resources.Get "css/variant.css" }}
{{- $assetBusting := partialCached "relearn/assetbusting.hugo" . }}
{{- $assetBusting := partialCached "assetbusting.hugo" . }}
{{- $variantcontent := print `@import "variables.css` $assetBusting `";` "\n\n" .Content }}
{{- range $page.Site.Params.boxStyle }}
{{- $identifier := upper .identifier }}

View file

@ -0,0 +1,2 @@
{{- warnf "DEPRECATED partial 'assetbusting.hugo' used, use 'assetbusting.gotmpl' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#700" }}
{{- partial "assetbusting.gotmpl" . }}

View file

@ -2,7 +2,7 @@
{{- $location := .location }}
{{- if eq $location "footer" }}
{{- with $page }}
{{- $assetBusting := partialCached "_relearn/assetbusting.gotmpl" . }}
{{- $assetBusting := partialCached "assetbusting.gotmpl" . }}
{{- $init := "{}" }}
{{- if isset .Params "mathjaxinitialize" }}
{{- $init = .Params.mathJaxInitialize }}

View file

@ -2,7 +2,7 @@
{{- $location := .location }}
{{- if eq $location "footer" }}
{{- with $page }}
{{- $assetBusting := partialCached "_relearn/assetbusting.gotmpl" . }}
{{- $assetBusting := partialCached "assetbusting.gotmpl" . }}
<script src="{{"js/d3/d3-color.min.js" | relURL}}{{ $assetBusting }}" defer></script>
<script src="{{"js/d3/d3-dispatch.min.js" | relURL}}{{ $assetBusting }}" defer></script>
<script src="{{"js/d3/d3-drag.min.js" | relURL}}{{ $assetBusting }}" defer></script>

View file

@ -2,7 +2,7 @@
{{- $location := .location }}
{{- if eq $location "footer" }}
{{- with $page }}
{{- $assetBusting := partialCached "_relearn/assetbusting.gotmpl" . }}
{{- $assetBusting := partialCached "assetbusting.gotmpl" . }}
<script src="{{"js/js-yaml.min.js" | relURL}}{{ $assetBusting }}" defer></script>
{{- $urlOpenapi := "" }}
{{- $relOpenapi := "" }}

View file

@ -1,4 +1,4 @@
{{- $assetBusting := partialCached "_relearn/assetbusting.gotmpl" . }}
{{- $assetBusting := partialCached "assetbusting.gotmpl" . }}
{{- $faviconMatch := false }}
{{- $svg := dict "ext" "svg" "type" "type=\"image/svg+xml\"" }}
{{- $png := dict "ext" "png" "type" "type=\"image/png\"" }}

View file

@ -0,0 +1 @@
{{- warnf "DEPRECATED partial 'page-meta.hugo' used, delete it from your templates; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#700" }}

View file

@ -0,0 +1,2 @@
{{- warnf "DEPRECATED partial 'pageHelper/title.hugo' used, use 'title.gotmpl' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#700" }}
{{- partial "title.gotmpl" . }}

View file

@ -0,0 +1,2 @@
{{- warnf "DEPRECATED partial 'relLangPrettyUglyURL.hugo' used, use 'permalink.gotmpl' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#700" }}
{{- partial "permalink.gotmpl" . }}

View file

@ -1,5 +1,5 @@
{{- if not .Site.Params.disableSearch }}
{{- $assetBusting := partialCached "_relearn/assetbusting.gotmpl" . }}
{{- $assetBusting := partialCached "assetbusting.gotmpl" . }}
{{- $link := "" }}
{{- with .Site.Home.OutputFormats.Get "json" }}
{{- warnf "UNSUPPORTED usage of 'json' output format found, use 'search' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#600" }}

View file

@ -4,7 +4,7 @@
{{- else }}
{{- warnf "WARNING no key `relearnOutputFormat` found in page store, set one by providing the file `layouts/_default/view/storeOutputFormat.<MYOUTPUTFORMAT>.html` for your self-defined output format; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#600" }}
{{- end }}
{{- $assetBusting := partialCached "_relearn/assetbusting.gotmpl" . }}
{{- $assetBusting := partialCached "assetbusting.gotmpl" . }}
{{- /* https://github.com/filamentgroup/loadCSS/blob/master/README.md#how-to-use */}}
<link href="{{"css/fontawesome-all.min.css" | relURL}}{{ $assetBusting }}" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="{{"css/fontawesome-all.min.css" | relURL}}{{ $assetBusting }}" rel="stylesheet"></noscript>
<link href="{{"css/nucleus.css" | relURL}}{{ $assetBusting }}" rel="stylesheet">