From 46779476a570346661a2741607265caed42829b2 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sat, 18 Apr 2026 18:19:47 +0200 Subject: consolidated duplicated shortcodes. Initial fix of the content files. Manual review needed --- themes/danix-xyz-hacker/assets/css/main.min.css | 5 -- .../layouts/shortcodes/figure.html | 8 --- .../layouts/shortcodes/gal-img.html | 3 - .../danix-xyz-hacker/layouts/shortcodes/image.html | 27 ++++---- .../danix-xyz-hacker/layouts/shortcodes/img.html | 1 - .../danix-xyz-hacker/layouts/shortcodes/video.html | 76 ++++++++++------------ .../layouts/shortcodes/youtube.html | 1 - 7 files changed, 49 insertions(+), 72 deletions(-) delete mode 100644 themes/danix-xyz-hacker/layouts/shortcodes/figure.html delete mode 100644 themes/danix-xyz-hacker/layouts/shortcodes/gal-img.html delete mode 100644 themes/danix-xyz-hacker/layouts/shortcodes/img.html delete mode 100644 themes/danix-xyz-hacker/layouts/shortcodes/youtube.html (limited to 'themes') diff --git a/themes/danix-xyz-hacker/assets/css/main.min.css b/themes/danix-xyz-hacker/assets/css/main.min.css index fecb6d1..9ce65bf 100644 --- a/themes/danix-xyz-hacker/assets/css/main.min.css +++ b/themes/danix-xyz-hacker/assets/css/main.min.css @@ -1747,11 +1747,6 @@ article.border.border-border\/30.rounded-lg.card.group.bg-bg { margin-bottom: 3rem; } -.my-4 { - margin-top: 1rem; - margin-bottom: 1rem; -} - .my-6 { margin-top: 1.5rem; margin-bottom: 1.5rem; diff --git a/themes/danix-xyz-hacker/layouts/shortcodes/figure.html b/themes/danix-xyz-hacker/layouts/shortcodes/figure.html deleted file mode 100644 index 27d6cb2..0000000 --- a/themes/danix-xyz-hacker/layouts/shortcodes/figure.html +++ /dev/null @@ -1,8 +0,0 @@ -{{- $src := .Get "src" -}} -{{- $alt := .Get "alt" -}} -{{- $class := .Get "class" -}} -
- {{- if $src -}}{{ $alt }}{{ end -}} - {{- .Inner -}} - {{- if .Get "caption" -}}
{{ .Get "caption" }}
{{ end -}} -
diff --git a/themes/danix-xyz-hacker/layouts/shortcodes/gal-img.html b/themes/danix-xyz-hacker/layouts/shortcodes/gal-img.html deleted file mode 100644 index b9f8098..0000000 --- a/themes/danix-xyz-hacker/layouts/shortcodes/gal-img.html +++ /dev/null @@ -1,3 +0,0 @@ -
- {{ .Get -
diff --git a/themes/danix-xyz-hacker/layouts/shortcodes/image.html b/themes/danix-xyz-hacker/layouts/shortcodes/image.html index 0209b7e..84dec3f 100644 --- a/themes/danix-xyz-hacker/layouts/shortcodes/image.html +++ b/themes/danix-xyz-hacker/layouts/shortcodes/image.html @@ -1,22 +1,23 @@ {{- $src := .Get "src" -}} {{- $alt := .Get "alt" | default "Image" -}} {{- $caption := .Get "caption" -}} -{{- $class := .Get "class" | default "w-full h-auto rounded-lg border border-border/30" -}} +{{- $class := .Get "class" | default "w-full h-auto rounded-lg border border-border" -}} +{{- $link := .Get "link" -}} +{{- $figureClass := .Get "figure-class" -}} -{{- if $src -}} -
- {{ $alt }} +{{- if or $src .Inner -}} +
+ {{- if .Inner -}} + {{- .Inner -}} + {{- else -}} + {{- if $link -}}{{- end -}} + {{ $alt }} + {{- if $link -}}{{- end -}} + {{- end -}} {{- if $caption -}} -
- {{ $caption }} -
+
{{ $caption }}
{{- end -}}
{{- else -}} - {{- errorf "image shortcode: 'src' parameter is required" -}} + {{- errorf "image shortcode: 'src' parameter or inner content is required" -}} {{- end -}} diff --git a/themes/danix-xyz-hacker/layouts/shortcodes/img.html b/themes/danix-xyz-hacker/layouts/shortcodes/img.html deleted file mode 100644 index 2393928..0000000 --- a/themes/danix-xyz-hacker/layouts/shortcodes/img.html +++ /dev/null @@ -1 +0,0 @@ -{{ .Get diff --git a/themes/danix-xyz-hacker/layouts/shortcodes/video.html b/themes/danix-xyz-hacker/layouts/shortcodes/video.html index a07500a..1e2645d 100644 --- a/themes/danix-xyz-hacker/layouts/shortcodes/video.html +++ b/themes/danix-xyz-hacker/layouts/shortcodes/video.html @@ -1,43 +1,37 @@ -{{/* - * The video shortcode: - * All arguments are optional, except for src which is where you define your video file - * This shortcode supports only webm video files. - * Args: - * class: [string] The class(es) to give to the video block. - * width: [int] The width of the video - * height: [int] The height of the video - * autoplay: [bool] true or false for autoplay - defaults to false - * loop: [bool] true or false for loop - defaults to false - * mute: [bool] true or false for mute - defaults to false - * - * Usage: - * {{< video src="my-awesome-video.mp4" width=600 height=600 autoplay=true loop=true mute=true class="some class" >}} - * - * Output: - * - * - */}} +{{- $src := .Get "src" -}} +{{- $id := .Get "id" -}} +{{- $title := .Get "title" | default "Video" -}} +{{- $class := .Get "class" | default "" -}} -{{ $srcParam := .Get "src" }} -{{ $ext := $srcParam | path.Ext }} -{{ $filetype := slicestr $ext 1 }} - -{{ $videoURL := $srcParam }} -{{ $resource := .Page.Resources.GetMatch $srcParam }} -{{ if $resource }} - {{ $videoURL = $resource.RelPermalink }} -{{ end }} - - +{{- if $id -}} +
+ +
+{{- else if $src -}} + {{- $ext := $src | path.Ext -}} + {{- $filetype := slicestr $ext 1 -}} + {{- $videoURL := $src -}} + {{- $resource := .Page.Resources.GetMatch $src -}} + {{- if $resource -}}{{- $videoURL = $resource.RelPermalink -}}{{- end -}} + + +{{- else -}} + {{- errorf "video shortcode: either 'src' or 'id' parameter is required" -}} +{{- end -}} diff --git a/themes/danix-xyz-hacker/layouts/shortcodes/youtube.html b/themes/danix-xyz-hacker/layouts/shortcodes/youtube.html deleted file mode 100644 index 80cbb93..0000000 --- a/themes/danix-xyz-hacker/layouts/shortcodes/youtube.html +++ /dev/null @@ -1 +0,0 @@ - -- cgit v1.2.3