mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-01-18 10:50:24 +00:00
theme: remove code for older hugo versions #679
This commit is contained in:
parent
f9887d1d44
commit
0d51f64dfd
8 changed files with 8 additions and 43 deletions
|
@ -1,10 +1,4 @@
|
|||
{{- $version := split hugo.Version "." }}
|
||||
{{- $major := int (index $version 0) }}
|
||||
{{- $minor := int (index $version 1) }}
|
||||
{{- $id := "" }}
|
||||
{{- if or (and (eq $major 0) (ge $minor 108)) (gt $major 0) }}
|
||||
{{- $id = "" }}
|
||||
{{- end }}
|
||||
{{- partial "shortcodes/image.html" (dict
|
||||
"page" .Page
|
||||
"url" .Destination
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
{{- $basename = partial "BaseName.hugo" $format.RelPermalink }}
|
||||
{{- end }}
|
||||
{{- if eq . .Site.Sites.First.Home }}
|
||||
{{- $minHugoVersion := "0.110.0" }}
|
||||
{{- if lt hugo.Version $minHugoVersion }}
|
||||
{{- errorf "The Relearn theme requires Hugo %s or later" $minHugoVersion }}
|
||||
{{- $hugoVersion := "0.110.0" }}
|
||||
{{- if lt hugo.Version $hugoVersion }}
|
||||
{{- errorf "The Relearn theme requires Hugo %s or later" $hugoVersion }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
<html lang="{{ .Page.Language | default "en" }}" dir="{{ T "Reading-direction" | default "ltr" }}">
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
{{- $version := split hugo.Version "." }}
|
||||
{{- $major := int (index $version 0) }}
|
||||
{{- $minor := int (index $version 1) }}
|
||||
{{- $page := .page }}
|
||||
{{- if and (not $page) .context }}
|
||||
{{- $page = .context }}
|
||||
|
@ -43,7 +40,8 @@
|
|||
{{- $urlPrefix := strings.TrimRight "/" $page.RelPermalink }}
|
||||
{{- with $page }}
|
||||
{{- if ne .BundleType "leaf" }}
|
||||
{{- if or (and (eq $major 0) (ge $minor 112)) (gt $major 0) }}
|
||||
{{- $hugoVersion := "0.112.0" }}
|
||||
{{- if ge hugo.Version $hugoVersion }}
|
||||
{{- warnf "%q: UNSUPPORTED usage of 'attachments' shortcode found while using Hugo >= 0.112.0, use a leaf bundle instead; see https://mcshelby.github.io/hugo-theme-relearn/shortcodes/attachments/index.html#single-language" $page.File.Filename }}
|
||||
{{- else }}
|
||||
{{- warnf "%q: DEPRECATED usage of 'attachments' shortcode found which will not be compatible while using Hugo >= 0.112.0, use a leaf bundle instead; see https://mcshelby.github.io/hugo-theme-relearn/shortcodes/attachments/index.html#single-language" $page.File.Filename }}
|
||||
|
@ -53,7 +51,8 @@
|
|||
<div class="box-label">{{ if $icon }}<i class="{{ $icon }}"></i>{{ end }}{{ if and $icon $title }} {{ end }}{{ $title | .RenderString }}</div>
|
||||
<ul class="box-content attachments-files">
|
||||
{{- $fileDir := "" }}
|
||||
{{- if or (and (eq $major 0) (ge $minor 112)) (gt $major 0) }}
|
||||
{{- $hugoVersion := "0.112.0" }}
|
||||
{{- if ge hugo.Version $hugoVersion }}
|
||||
{{- $fileDir = path.Dir (strings.TrimPrefix (path.Clean hugo.WorkingDir) (path.Clean .File.Filename)) }}
|
||||
{{- else }}
|
||||
{{- $fileDir = printf "%s/%s" (path.Clean (.Language.ContentDir | default "content")) (path.Clean .File.Dir) }}
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
{{- $_hugo_config := `{ "version": 1 }` }}
|
||||
{{- $version := split hugo.Version "." }}
|
||||
{{- $major := int (index $version 0) }}
|
||||
{{- $minor := int (index $version 1) }}
|
||||
{{- $id := "" }}
|
||||
{{- if or (and (eq $major 0) (ge $minor 108)) (gt $major 0) }}
|
||||
{{- $id = "" }}
|
||||
{{- end }}
|
||||
{{- partial "shortcodes/expand.html" (dict
|
||||
"page" .Page
|
||||
"content" .Inner
|
||||
|
|
|
@ -1,12 +1,5 @@
|
|||
{{- $version := split hugo.Version "." }}
|
||||
{{- $major := int (index $version 0) }}
|
||||
{{- $minor := int (index $version 1) }}
|
||||
{{- $content := "" }}
|
||||
{{- if or (and (eq $major 0) (ge $minor 110)) (gt $major 0) }}
|
||||
{{- $content = .InnerDeindent }}
|
||||
{{- else }}
|
||||
{{- $content = .Inner }}
|
||||
{{- end }}
|
||||
{{- $content = .InnerDeindent }}
|
||||
{{- $attributes := dict }}
|
||||
{{- $options := dict }}
|
||||
{{- $type := "" }}
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
{{- $version := split hugo.Version "." }}
|
||||
{{- $major := int (index $version 0) }}
|
||||
{{- $minor := int (index $version 1) }}
|
||||
{{- $id := "" }}
|
||||
{{- if or (and (eq $major 0) (ge $minor 108)) (gt $major 0) }}
|
||||
{{- $id = "" }}
|
||||
{{- end }}
|
||||
{{- partial "shortcodes/openapi.html" (dict
|
||||
"page" .Page
|
||||
"src" (.Get "src")
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
{{- $version := split hugo.Version "." }}
|
||||
{{- $major := int (index $version 0) }}
|
||||
{{- $minor := int (index $version 1) }}
|
||||
{{- $id := "" }}
|
||||
{{- if or (and (eq $major 0) (ge $minor 108)) (gt $major 0) }}
|
||||
{{- $id = "" }}
|
||||
{{- end }}
|
||||
{{- partial "shortcodes/swagger.html" (dict
|
||||
"page" .Page
|
||||
"src" (.Get "src")
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
{{- $unused := .Inner }}
|
||||
{{- $version := split hugo.Version "." }}
|
||||
{{- $major := int (index $version 0) }}
|
||||
{{- $minor := int (index $version 1) }}
|
||||
{{- $color := (.Get "color") }}
|
||||
{{- $groupid := ((.Get "groupid") | default (.Get "groupId")) }}
|
||||
{{- if (.Get "groupId") }}
|
||||
|
|
Loading…
Reference in a new issue