initial commit
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
{{- $_hugo_config := `{ "version": 1 }` }}
|
||||
{{- $unused := .Inner }}
|
||||
{{- partial "shortcodes/attachments.html" (dict
|
||||
"page" .Page
|
||||
"color" (.Get "color")
|
||||
"icon" (.Get "icon")
|
||||
"pattern" (.Get "pattern")
|
||||
"style" (.Get "style")
|
||||
"sort" (.Get "sort")
|
||||
"title" (.Get "title")
|
||||
) }}
|
||||
9
themes/hugo-theme-relearn/layouts/shortcodes/badge.html
Normal file
9
themes/hugo-theme-relearn/layouts/shortcodes/badge.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{{- $_hugo_config := `{ "version": 1 }` }}
|
||||
{{- partial "shortcodes/badge.html" (dict
|
||||
"page" .Page
|
||||
"color" (.Get "color")
|
||||
"content" .Inner
|
||||
"icon" (.Get "icon")
|
||||
"style" (.Get "style")
|
||||
"title" (.Get "title")
|
||||
) }}
|
||||
17
themes/hugo-theme-relearn/layouts/shortcodes/button.html
Normal file
17
themes/hugo-theme-relearn/layouts/shortcodes/button.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{{- $_hugo_config := `{ "version": 1 }` }}
|
||||
{{- if (.Get "icon-position") }}
|
||||
{{- $filepath := "[virtual file]" }}{{ with and .Page .Page.File .Page.File.Filename }}{{ $filepath = . }}{{ end }}
|
||||
{{- warnf "%q: DEPRECATED parameter 'icon-position' for shortcode 'button' found, use 'iconposition' instead; see https://mcshelby.github.io/hugo-theme-relearn/shortcodes/button#parameter" $filepath }}
|
||||
{{- end }}
|
||||
{{- partial "shortcodes/button.html" (dict
|
||||
"page" .Page
|
||||
"color" (.Get "color")
|
||||
"content" .Inner
|
||||
"href" (.Get "href")
|
||||
"icon" (.Get "icon")
|
||||
"iconposition" ((.Get "iconposition") | default (.Get "icon-position"))
|
||||
"style" (.Get "style")
|
||||
"title" (.Get "title")
|
||||
"target" (.Get "target")
|
||||
"type" (.Get "type")
|
||||
) }}
|
||||
10
themes/hugo-theme-relearn/layouts/shortcodes/children.html
Normal file
10
themes/hugo-theme-relearn/layouts/shortcodes/children.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{{- $_hugo_config := `{ "version": 1 }` }}
|
||||
{{- partial "shortcodes/children.html" (dict
|
||||
"page" .Page
|
||||
"containerstyle" (.Get "containerstyle")
|
||||
"description" (.Get "description")
|
||||
"depth" (.Get "depth")
|
||||
"showhidden" (.Get "showhidden")
|
||||
"sort" (.Get "sort")
|
||||
"style" (.Get "style")
|
||||
) }}
|
||||
23
themes/hugo-theme-relearn/layouts/shortcodes/details.html
Normal file
23
themes/hugo-theme-relearn/layouts/shortcodes/details.html
Normal file
@@ -0,0 +1,23 @@
|
||||
{{- $summary := (.Get "summary") | default (T "Details") }}
|
||||
{{- $open := false }}
|
||||
{{- if in (slice "false" false 0) (.Get "open") }}
|
||||
{{- $open = false }}
|
||||
{{- else if in (slice "true" true 1) (.Get "open")}}
|
||||
{{- $open = true }}
|
||||
{{- end }}
|
||||
{{- $params := dict }}
|
||||
{{- with (.Get "class") }}
|
||||
{{- $params = $params | merge (dict "class" .) }}
|
||||
{{- end }}
|
||||
{{- with (.Get "title") }}
|
||||
{{- $params = $params | merge (dict "title" .) }}
|
||||
{{- end }}
|
||||
{{- partial "shortcodes/notice.html" (dict
|
||||
"page" .Page
|
||||
"content" .Inner
|
||||
"expanded" $open
|
||||
"groupid" (.Get "name")
|
||||
"params" $params
|
||||
"style" "transparent"
|
||||
"title" $summary
|
||||
) }}
|
||||
8
themes/hugo-theme-relearn/layouts/shortcodes/expand.html
Normal file
8
themes/hugo-theme-relearn/layouts/shortcodes/expand.html
Normal file
@@ -0,0 +1,8 @@
|
||||
{{- $_hugo_config := `{ "version": 1 }` }}
|
||||
{{- partial "shortcodes/expand.html" (dict
|
||||
"page" .Page
|
||||
"content" .Inner
|
||||
"open" (.Get "open" | default "")
|
||||
"expanded" (.Get "expanded" | default (.Get 1))
|
||||
"title" (.Get "title" | default (.Get 0))
|
||||
) }}
|
||||
27
themes/hugo-theme-relearn/layouts/shortcodes/highlight.html
Normal file
27
themes/hugo-theme-relearn/layouts/shortcodes/highlight.html
Normal file
@@ -0,0 +1,27 @@
|
||||
{{- $content := "" }}
|
||||
{{- $content = .InnerDeindent }}
|
||||
{{- $attributes := dict }}
|
||||
{{- $options := dict }}
|
||||
{{- $type := "" }}
|
||||
{{- range $k, $v := .Params }}
|
||||
{{- if eq $k 0 }}
|
||||
{{- $type = $v }}
|
||||
{{- else if eq $k 1 }}
|
||||
{{- $options = $v }}
|
||||
{{- else if eq $k "type" }}
|
||||
{{- $type = $v }}
|
||||
{{- else if eq $k "title" }}
|
||||
{{- $attributes = $attributes | merge (dict $k $v) }}
|
||||
{{- else if eq $k "wrap" }}
|
||||
{{- $attributes = $attributes | merge (dict $k $v) }}
|
||||
{{- else }}
|
||||
{{- $options = $options | merge (dict $k $v) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- partial "shortcodes/highlight.html" (dict
|
||||
"page" .Page
|
||||
"attributes" $attributes
|
||||
"content" $content
|
||||
"options" $options
|
||||
"type" $type
|
||||
) }}
|
||||
5
themes/hugo-theme-relearn/layouts/shortcodes/icon.html
Normal file
5
themes/hugo-theme-relearn/layouts/shortcodes/icon.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{{- $_hugo_config := `{ "version": 1 }` }}
|
||||
{{- partial "shortcodes/icon.html" (dict
|
||||
"page" .Page
|
||||
"icon" (.Get "icon" | default (.Get 0))
|
||||
) }}
|
||||
@@ -0,0 +1,9 @@
|
||||
{{- if (.Get "showfirstheading") }}
|
||||
{{- $filepath := "[virtual file]" }}{{ with and .Page .Page.File .Page.File.Filename }}{{ $filepath = . }}{{ end }}
|
||||
{{- warnf "%q: UNSUPPORTED parameter 'showfirstheading' for shortcode 'include' found, use 'hidefirstheading' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/4/#4-2-0" $filepath }}
|
||||
{{- end }}
|
||||
{{- partial "shortcodes/include.html" (dict
|
||||
"page" .Page
|
||||
"file" (.Get "file" | default (.Get 0))
|
||||
"hidefirstheading" (.Get "hidefirstheading" | default (.Get 1))
|
||||
) }}
|
||||
6
themes/hugo-theme-relearn/layouts/shortcodes/math.html
Normal file
6
themes/hugo-theme-relearn/layouts/shortcodes/math.html
Normal file
@@ -0,0 +1,6 @@
|
||||
{{- $_hugo_config := `{ "version": 1 }` }}
|
||||
{{- partial "shortcodes/math.html" (dict
|
||||
"page" .Page
|
||||
"content" .Inner
|
||||
"align" (.Get "align")
|
||||
) }}
|
||||
@@ -0,0 +1,7 @@
|
||||
{{- $_hugo_config := `{ "version": 1 }` }}
|
||||
{{- partial "shortcodes/mermaid.html" (dict
|
||||
"page" .Page
|
||||
"content" .Inner
|
||||
"align" (.Get "align")
|
||||
"zoom" (.Get "zoom")
|
||||
) }}
|
||||
11
themes/hugo-theme-relearn/layouts/shortcodes/notice.html
Normal file
11
themes/hugo-theme-relearn/layouts/shortcodes/notice.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{{- $_hugo_config := `{ "version": 1 }` }}
|
||||
{{- partial "shortcodes/notice.html" (dict
|
||||
"page" .Page
|
||||
"color" (.Get "color")
|
||||
"content" .Inner
|
||||
"expanded" (.Get "expanded")
|
||||
"groupid" (.Get "groupid")
|
||||
"icon" (.Get "icon" | default (.Get 2))
|
||||
"style" (.Get "style" | default (.Get 0))
|
||||
"title" (.Get "title" | default (.Get 1))
|
||||
) }}
|
||||
@@ -0,0 +1,6 @@
|
||||
{{- $id := "" }}
|
||||
{{- partial "shortcodes/openapi.html" (dict
|
||||
"page" .Page
|
||||
"src" (.Get "src")
|
||||
"id" $id
|
||||
) }}
|
||||
5
themes/hugo-theme-relearn/layouts/shortcodes/relref.html
Normal file
5
themes/hugo-theme-relearn/layouts/shortcodes/relref.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{{- if site.Params.disableDefaultRelref }}
|
||||
{{- .Get "path" | default (.Get 0) }}
|
||||
{{- else }}
|
||||
{{- relref . .Params }}
|
||||
{{- end }}
|
||||
12
themes/hugo-theme-relearn/layouts/shortcodes/resources.html
Normal file
12
themes/hugo-theme-relearn/layouts/shortcodes/resources.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{{- $_hugo_config := `{ "version": 1 }` }}
|
||||
{{- $unused := .Inner }}
|
||||
{{- partial "shortcodes/resources.html" (dict
|
||||
"page" .Page
|
||||
"color" (.Get "color")
|
||||
"expanded" (.Get "expanded")
|
||||
"icon" (.Get "icon")
|
||||
"pattern" (.Get "pattern")
|
||||
"style" (.Get "style")
|
||||
"sort" (.Get "sort")
|
||||
"title" (.Get "title")
|
||||
) }}
|
||||
@@ -0,0 +1,4 @@
|
||||
{{- partial "shortcodes/siteparam.html" (dict
|
||||
"page" .Page
|
||||
"name" (.Get "name" | default (.Get 0))
|
||||
) }}
|
||||
33
themes/hugo-theme-relearn/layouts/shortcodes/tab.html
Normal file
33
themes/hugo-theme-relearn/layouts/shortcodes/tab.html
Normal file
@@ -0,0 +1,33 @@
|
||||
{{- $_hugo_config := `{ "version": 1 }` }}
|
||||
{{- $color := (.Get "color") }}
|
||||
{{- $content := .Inner }}
|
||||
{{- $icon := (.Get "icon") }}
|
||||
{{- $name := (.Get "name") }}
|
||||
{{- $style := (.Get "style") }}
|
||||
{{- $title := (.Get "title") }}
|
||||
{{- $tabs := slice }}
|
||||
{{- if and .Parent (.Parent.Scratch.Get "tabs") }}
|
||||
{{- $tabs = .Parent.Scratch.Get "tabs" }}
|
||||
{{- end }}
|
||||
{{- $tabs = $tabs | append (dict
|
||||
"color" $color
|
||||
"content" $content
|
||||
"icon" $icon
|
||||
"name" $name
|
||||
"style" $style
|
||||
"title" $title
|
||||
) }}
|
||||
{{- if .Parent }}
|
||||
{{- $.Parent.Scratch.Set "tabs" $tabs }}
|
||||
{{- else }}
|
||||
{{- /* if no containing tabs shortcode is present, we display this tab as single */}}
|
||||
{{- partial "shortcodes/tabs.html" (dict
|
||||
"page" .Page
|
||||
"color" ""
|
||||
"content" $tabs
|
||||
"groupid" ""
|
||||
"icon" ""
|
||||
"style" ""
|
||||
"title" ""
|
||||
) }}
|
||||
{{- end }}
|
||||
20
themes/hugo-theme-relearn/layouts/shortcodes/tabs.html
Normal file
20
themes/hugo-theme-relearn/layouts/shortcodes/tabs.html
Normal file
@@ -0,0 +1,20 @@
|
||||
{{- $unused := .Inner }}
|
||||
{{- $color := (.Get "color") }}
|
||||
{{- $groupid := ((.Get "groupid") | default (.Get "groupId")) }}
|
||||
{{- if (.Get "groupId") }}
|
||||
{{- $filepath := "[virtual file]" }}{{ with and .Page .Page.File .Page.File.Filename }}{{ $filepath = . }}{{ end }}
|
||||
{{- warnf "%q: DEPRECATED parameter 'groupId' for shortcode 'tabs' found, use 'groupid' instead; see https://mcshelby.github.io/hugo-theme-relearn/shortcodes/tabs#parameter" $filepath }}
|
||||
{{- end }}
|
||||
{{- $icon := (.Get "icon") }}
|
||||
{{- $style := (.Get "style") }}
|
||||
{{- $title := (.Get "title") }}
|
||||
{{- $tabs := (.Scratch.Get "tabs") }}
|
||||
{{- partial "shortcodes/tabs.html" (dict
|
||||
"page" .Page
|
||||
"color" $color
|
||||
"content" $tabs
|
||||
"groupid" $groupid
|
||||
"icon" $icon
|
||||
"style" $style
|
||||
"title" $title
|
||||
) }}
|
||||
Reference in New Issue
Block a user