Skip to content

Commit

Permalink
theme: add migration layer #891
Browse files Browse the repository at this point in the history
  • Loading branch information
McShelby committed Sep 13, 2024
1 parent bdc1bac commit d1dcb05
Show file tree
Hide file tree
Showing 19 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion assets/css/auto.css
Original file line number Diff line number Diff line change
@@ -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);
2 changes: 1 addition & 1 deletion assets/css/format-print.css
Original file line number Diff line number Diff line change
@@ -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 }}";

Expand Down
2 changes: 1 addition & 1 deletion assets/css/print.css
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{{- $assetBusting := partialCached "_relearn/assetbusting.gotmpl" . -}}
{{- $assetBusting := partialCached "assetbusting.gotmpl" . -}}
@import "{{ printf "format-print.css%s" $assetBusting }}";
2 changes: 1 addition & 1 deletion assets/css/swagger.css
Original file line number Diff line number Diff line change
@@ -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 }}";
Expand Down
2 changes: 1 addition & 1 deletion assets/css/theme-relearn.css
Original file line number Diff line number Diff line change
@@ -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 }}";
2 changes: 1 addition & 1 deletion exampleSite/layouts/partials/menu-footer.html
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -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") }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/_relearn/themeVariants.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions layouts/partials/assetbusting.hugo
Original file line number Diff line number Diff line change
@@ -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" . }}
2 changes: 1 addition & 1 deletion layouts/partials/dependencies/mathjax.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/dependencies/mermaid.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/dependencies/openapi.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 := "" }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/favicon.html
Original file line number Diff line number Diff line change
@@ -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\"" }}
Expand Down
1 change: 1 addition & 0 deletions layouts/partials/page-meta.hugo
Original file line number Diff line number Diff line change
@@ -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" }}
2 changes: 2 additions & 0 deletions layouts/partials/pageHelper/title.hugo
Original file line number Diff line number Diff line change
@@ -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" . }}
2 changes: 2 additions & 0 deletions layouts/partials/relLangPrettyUglyURL.hugo
Original file line number Diff line number Diff line change
@@ -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" . }}
2 changes: 1 addition & 1 deletion layouts/partials/search.html
Original file line number Diff line number Diff line change
@@ -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" }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/stylesheet.html
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down

0 comments on commit d1dcb05

Please sign in to comment.