From 568553394d0a8b34668a75c9839a0f1f426469b2 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sun, 6 Oct 2019 21:10:46 +0200 Subject: theme: Switch to docsy theme --- themes/docsy/layouts/shortcodes/alert.html | 6 ++++ themes/docsy/layouts/shortcodes/blocks/cover.html | 40 ++++++++++++++++++++++ .../docsy/layouts/shortcodes/blocks/feature.html | 10 ++++++ themes/docsy/layouts/shortcodes/blocks/lead.html | 12 +++++++ .../docsy/layouts/shortcodes/blocks/link-down.html | 7 ++++ .../docsy/layouts/shortcodes/blocks/section.html | 12 +++++++ themes/docsy/layouts/shortcodes/imgproc.html | 21 ++++++++++++ themes/docsy/layouts/shortcodes/pageinfo.html | 5 +++ themes/docsy/layouts/shortcodes/readfile.md | 8 +++++ themes/docsy/layouts/shortcodes/swaggerui.html | 16 +++++++++ 10 files changed, 137 insertions(+) create mode 100644 themes/docsy/layouts/shortcodes/alert.html create mode 100644 themes/docsy/layouts/shortcodes/blocks/cover.html create mode 100644 themes/docsy/layouts/shortcodes/blocks/feature.html create mode 100644 themes/docsy/layouts/shortcodes/blocks/lead.html create mode 100644 themes/docsy/layouts/shortcodes/blocks/link-down.html create mode 100644 themes/docsy/layouts/shortcodes/blocks/section.html create mode 100644 themes/docsy/layouts/shortcodes/imgproc.html create mode 100644 themes/docsy/layouts/shortcodes/pageinfo.html create mode 100644 themes/docsy/layouts/shortcodes/readfile.md create mode 100644 themes/docsy/layouts/shortcodes/swaggerui.html (limited to 'themes/docsy/layouts/shortcodes') diff --git a/themes/docsy/layouts/shortcodes/alert.html b/themes/docsy/layouts/shortcodes/alert.html new file mode 100644 index 0000000..ff3b0b3 --- /dev/null +++ b/themes/docsy/layouts/shortcodes/alert.html @@ -0,0 +1,6 @@ +{{ $_hugo_config := `{ "version": 1 }` }} +{{ $color := .Get "color" | default "primary" }} + diff --git a/themes/docsy/layouts/shortcodes/blocks/cover.html b/themes/docsy/layouts/shortcodes/blocks/cover.html new file mode 100644 index 0000000..5e14d6d --- /dev/null +++ b/themes/docsy/layouts/shortcodes/blocks/cover.html @@ -0,0 +1,40 @@ +{{ $_hugo_config := `{ "version": 1 }` }} +{{ $blockID := printf "td-cover-block-%d" .Ordinal }} +{{ $promo_image := (.Page.Resources.ByType "image").GetMatch "**background*" }} +{{ $logo_image := (.Page.Resources.ByType "image").GetMatch "**logo*" }} +{{ $col_id := .Get "color" | default "dark" }} +{{ $image_anchor := .Get "image_anchor" | default "smart" }} +{{ $logo_anchor := .Get "logo_anchor" | default "smart" }} +{{/* Height can be one of: auto, min, med, max, full. */}} +{{ $height := .Get "height" | default "max" }} +{{ with $promo_image }} +{{ $promo_image_big := (.Fill (printf "1920x1080 %s" $image_anchor)) }} +{{ $promo_image_small := (.Fill (printf "960x540 %s" $image_anchor)) }} + + + +{{ end }} +
+
+
+
+
+ {{ with .Get "title" }}

{{ $title := . }}{{ with $logo_image }}{{ $logo_image_resized := (.Fit (printf "70x70 %s" $logo_anchor)) }}{{ end }}{{ $title | html }}

{{ end }} + {{ with .Get "subtitle" }}

{{ . | html }}

{{ end }} +
+ {{ .Inner | markdownify}} +
+
+
+
+
+
diff --git a/themes/docsy/layouts/shortcodes/blocks/feature.html b/themes/docsy/layouts/shortcodes/blocks/feature.html new file mode 100644 index 0000000..d734dfb --- /dev/null +++ b/themes/docsy/layouts/shortcodes/blocks/feature.html @@ -0,0 +1,10 @@ +{{ $icon := .Get "icon" | default "fa-lightbulb" }} +{{ $url_text := .Get "url_text" }} +
+
+ +
+

{{ .Get "title" | markdownify }}

+

{{ .Inner }}

+ {{ with .Get "url" }}

{{ with $url_text }}{{ $url_text }}{{ else }}{{ T "ui_read_more" }}{{ end }} …

{{ end }} +
diff --git a/themes/docsy/layouts/shortcodes/blocks/lead.html b/themes/docsy/layouts/shortcodes/blocks/lead.html new file mode 100644 index 0000000..f57ebb1 --- /dev/null +++ b/themes/docsy/layouts/shortcodes/blocks/lead.html @@ -0,0 +1,12 @@ +{{ $_hugo_config := `{ "version": 1 }` }} +{{ $col_id := .Get "color" | default .Ordinal }} +{{ $height := .Get "height" | default "auto" }} +{{/* Height can be one of: auto, min, med, max, full. */}} + +
+
+ + {{ .Inner | markdownify }} + +
+
diff --git a/themes/docsy/layouts/shortcodes/blocks/link-down.html b/themes/docsy/layouts/shortcodes/blocks/link-down.html new file mode 100644 index 0000000..6395866 --- /dev/null +++ b/themes/docsy/layouts/shortcodes/blocks/link-down.html @@ -0,0 +1,7 @@ +{{ with .Parent }} +{{ $id := $.Get "id" | default (printf "td-block-%d" ( add .Ordinal 1 )) }} +{{ $color := $.Get "color" | default "blue" }} + +{{ else }} +{{ errorf "The link-down shortcode is supposed to be nested inside a shortcode"}} +{{ end }} \ No newline at end of file diff --git a/themes/docsy/layouts/shortcodes/blocks/section.html b/themes/docsy/layouts/shortcodes/blocks/section.html new file mode 100644 index 0000000..d5897f6 --- /dev/null +++ b/themes/docsy/layouts/shortcodes/blocks/section.html @@ -0,0 +1,12 @@ +{{ $_hugo_config := `{ "version": 1 }` }} +{{ $col_id := .Get "color" | default .Ordinal }} +{{ $height := .Get "height" | default "auto" }} +{{ $type := .Get "type" | default "" }} + +
+
+
+ {{ .Inner | markdownify}} +
+
+
diff --git a/themes/docsy/layouts/shortcodes/imgproc.html b/themes/docsy/layouts/shortcodes/imgproc.html new file mode 100644 index 0000000..bb80a85 --- /dev/null +++ b/themes/docsy/layouts/shortcodes/imgproc.html @@ -0,0 +1,21 @@ +{{ $original := .Page.Resources.GetMatch (printf "**%s*" (.Get 0)) }} +{{ $command := .Get 1 }} +{{ $options := .Get 2 }} +{{ if eq $command "Fit"}} +{{ .Scratch.Set "image" ($original.Fit $options) }} +{{ else if eq $command "Resize"}} +{{ .Scratch.Set "image" ($original.Resize $options) }} +{{ else if eq $command "Fill"}} +{{ .Scratch.Set "image" ($original.Fill $options) }} +{{ else }} +{{ errorf "Invalid image processing command: Must be one of Fit, Fill or Resize."}} +{{ end }} +{{ $image := .Scratch.Get "image" }} +
+ + {{ with .Inner }} +
+

{{ . }}{{ with $image.Params.byline }}
{{ . | html }}
{{ end }}

+
+ {{ end }} +
\ No newline at end of file diff --git a/themes/docsy/layouts/shortcodes/pageinfo.html b/themes/docsy/layouts/shortcodes/pageinfo.html new file mode 100644 index 0000000..303f8c5 --- /dev/null +++ b/themes/docsy/layouts/shortcodes/pageinfo.html @@ -0,0 +1,5 @@ +{{ $_hugo_config := `{ "version": 1 }` }} +{{ $color := .Get "color" | default "primary" }} +
+{{ .Inner }} +
diff --git a/themes/docsy/layouts/shortcodes/readfile.md b/themes/docsy/layouts/shortcodes/readfile.md new file mode 100644 index 0000000..117c7e8 --- /dev/null +++ b/themes/docsy/layouts/shortcodes/readfile.md @@ -0,0 +1,8 @@ +{{$file := .Get "file"}} +{{- if eq (.Get "markdown") "true" -}} +{{- $file | readFile | markdownify -}} +{{- else if (.Get "highlight") -}} +{{- highlight ($file | readFile) (.Get "highlight") "" -}} +{{- else -}} +{{ $file | readFile | safeHTML }} +{{- end -}} diff --git a/themes/docsy/layouts/shortcodes/swaggerui.html b/themes/docsy/layouts/shortcodes/swaggerui.html new file mode 100644 index 0000000..f0d59a1 --- /dev/null +++ b/themes/docsy/layouts/shortcodes/swaggerui.html @@ -0,0 +1,16 @@ +{{ $original := .Get "src" }} +
+ \ No newline at end of file -- cgit v1.2.3