diff --git a/layouts/shortcodes/attachments.html b/layouts/shortcodes/attachments.html new file mode 100644 index 0000000..d44408b --- /dev/null +++ b/layouts/shortcodes/attachments.html @@ -0,0 +1,11 @@ +{{- $_hugo_config := `{ "version": 1 }` }} +{{- partial "shortcodes/attachments.html" (dict + "page" .Page + "color" (.Get "color") + "content" .Inner + "icon" (.Get "icon") + "pattern" (.Get "pattern") + "style" (.Get "style") + "sort" (.Get "sort") + "title" (.Get "title") +) }} \ No newline at end of file diff --git a/layouts/shortcodes/badge.html b/layouts/shortcodes/badge.html new file mode 100644 index 0000000..939d87a --- /dev/null +++ b/layouts/shortcodes/badge.html @@ -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") +) }} \ No newline at end of file diff --git a/layouts/shortcodes/button.html b/layouts/shortcodes/button.html new file mode 100644 index 0000000..3d8ffa9 --- /dev/null +++ b/layouts/shortcodes/button.html @@ -0,0 +1,16 @@ +{{- $_hugo_config := `{ "version": 1 }` }} +{{- if (.Get "icon-position") }} + {{- warnf "%q: DEPRECATED parameter 'icon-position' for shortcode 'button' found, use 'iconposition' instead; see https://mcshelby.github.io/hugo-theme-relearn/shortcodes/button#parameter" .Page.File.Filename }} +{{- 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") +) }} \ No newline at end of file diff --git a/layouts/shortcodes/children.html b/layouts/shortcodes/children.html new file mode 100644 index 0000000..cd52aeb --- /dev/null +++ b/layouts/shortcodes/children.html @@ -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") +) }} \ No newline at end of file diff --git a/layouts/shortcodes/expand.html b/layouts/shortcodes/expand.html new file mode 100644 index 0000000..14b77be --- /dev/null +++ b/layouts/shortcodes/expand.html @@ -0,0 +1,9 @@ +{{- $_hugo_config := `{ "version": 1 }` }} +{{- $id := "" }} +{{- partial "shortcodes/expand.html" (dict + "page" .Page + "content" .Inner + "open" (.Get "open" | default (.Get 1)) + "title" (.Get "title" | default (.Get 0)) + "id" $id +) }} \ No newline at end of file diff --git a/layouts/shortcodes/highlight.html b/layouts/shortcodes/highlight.html new file mode 100644 index 0000000..22d7899 --- /dev/null +++ b/layouts/shortcodes/highlight.html @@ -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 +) }} \ No newline at end of file diff --git a/layouts/shortcodes/icon.html b/layouts/shortcodes/icon.html new file mode 100644 index 0000000..a0e422a --- /dev/null +++ b/layouts/shortcodes/icon.html @@ -0,0 +1,5 @@ +{{- $_hugo_config := `{ "version": 1 }` }} +{{- partial "shortcodes/icon.html" (dict + "page" .Page + "icon" (.Get "icon" | default (.Get 0)) +) }} \ No newline at end of file diff --git a/layouts/shortcodes/include.html b/layouts/shortcodes/include.html new file mode 100644 index 0000000..4c2ea61 --- /dev/null +++ b/layouts/shortcodes/include.html @@ -0,0 +1,8 @@ +{{- if (.Get "showfirstheading") }} + {{- warnf "%q: UNSUPPORTED parameter 'showfirstheading' for shortcode 'include' found, use 'hidefirstheading' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#420" .Page.File.Filename }} +{{- end }} +{{- partial "shortcodes/include.html" (dict + "page" .Page + "file" (.Get "file" | default (.Get 0)) + "hidefirstheading" (.Get "hidefirstheading" | default (.Get 1)) +) }} \ No newline at end of file diff --git a/layouts/shortcodes/math.html b/layouts/shortcodes/math.html new file mode 100644 index 0000000..5c7ae6d --- /dev/null +++ b/layouts/shortcodes/math.html @@ -0,0 +1,6 @@ +{{- $_hugo_config := `{ "version": 1 }` }} +{{- partial "shortcodes/math.html" (dict + "page" .Page + "content" .Inner + "align" (.Get "align") +) }} \ No newline at end of file diff --git a/layouts/shortcodes/mermaid.html b/layouts/shortcodes/mermaid.html new file mode 100644 index 0000000..e0c8820 --- /dev/null +++ b/layouts/shortcodes/mermaid.html @@ -0,0 +1,7 @@ +{{- $_hugo_config := `{ "version": 1 }` }} +{{- partial "shortcodes/mermaid.html" (dict + "page" .Page + "content" .Inner + "align" (.Get "align") + "zoom" (.Get "zoom") +) }} \ No newline at end of file diff --git a/layouts/shortcodes/notice.html b/layouts/shortcodes/notice.html new file mode 100644 index 0000000..83c4dec --- /dev/null +++ b/layouts/shortcodes/notice.html @@ -0,0 +1,9 @@ +{{- $_hugo_config := `{ "version": 1 }` }} +{{- partial "shortcodes/notice.html" (dict + "page" .Page + "color" (.Get "color") + "content" .Inner + "icon" (.Get "icon" | default (.Get 2)) + "style" (.Get "style" | default (.Get 0)) + "title" (.Get "title" | default (.Get 1)) +) }} \ No newline at end of file diff --git a/layouts/shortcodes/openapi.html b/layouts/shortcodes/openapi.html new file mode 100644 index 0000000..9277714 --- /dev/null +++ b/layouts/shortcodes/openapi.html @@ -0,0 +1,6 @@ +{{- $id := "" }} +{{- partial "shortcodes/openapi.html" (dict + "page" .Page + "src" (.Get "src") + "id" $id +) }} \ No newline at end of file diff --git a/layouts/shortcodes/ppt.html b/layouts/shortcodes/ppt.html new file mode 100644 index 0000000..e5a336f --- /dev/null +++ b/layouts/shortcodes/ppt.html @@ -0,0 +1,35 @@ + + + + + + + +
+ +
+ + + + \ No newline at end of file diff --git a/layouts/shortcodes/resources.html b/layouts/shortcodes/resources.html new file mode 100644 index 0000000..09f71ab --- /dev/null +++ b/layouts/shortcodes/resources.html @@ -0,0 +1,11 @@ +{{- $_hugo_config := `{ "version": 1 }` }} +{{- partial "shortcodes/resources.html" (dict + "page" .Page + "color" (.Get "color") + "content" .Inner + "icon" (.Get "icon") + "pattern" (.Get "pattern") + "style" (.Get "style") + "sort" (.Get "sort") + "title" (.Get "title") +) }} \ No newline at end of file diff --git a/layouts/shortcodes/siteparam.html b/layouts/shortcodes/siteparam.html new file mode 100644 index 0000000..3e48ba3 --- /dev/null +++ b/layouts/shortcodes/siteparam.html @@ -0,0 +1,4 @@ +{{- partial "shortcodes/siteparam.html" (dict + "page" .Page + "name" (.Get "name" | default (.Get 0)) +) }} \ No newline at end of file diff --git a/layouts/shortcodes/swagger.html b/layouts/shortcodes/swagger.html new file mode 100644 index 0000000..5da37b1 --- /dev/null +++ b/layouts/shortcodes/swagger.html @@ -0,0 +1,6 @@ +{{- $id := "" }} +{{- partial "shortcodes/swagger.html" (dict + "page" .Page + "src" (.Get "src") + "id" $id +) }} \ No newline at end of file diff --git a/layouts/shortcodes/tab.html b/layouts/shortcodes/tab.html new file mode 100644 index 0000000..bb5de89 --- /dev/null +++ b/layouts/shortcodes/tab.html @@ -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 }} \ No newline at end of file diff --git a/layouts/shortcodes/tabs.html b/layouts/shortcodes/tabs.html new file mode 100644 index 0000000..1e25a58 --- /dev/null +++ b/layouts/shortcodes/tabs.html @@ -0,0 +1,19 @@ +{{- $unused := .Inner }} +{{- $color := (.Get "color") }} +{{- $groupid := ((.Get "groupid") | default (.Get "groupId")) }} +{{- if (.Get "groupId") }} + {{- warnf "%q: DEPRECATED parameter 'groupId' for shortcode 'tabs' found, use 'groupid' instead; see https://mcshelby.github.io/hugo-theme-relearn/shortcodes/tabs#parameter" .Page.File.Filename }} +{{- 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 +) }} \ No newline at end of file