summaryrefslogtreecommitdiffstats
path: root/themes/danix-xyz-hacker/layouts/shortcodes
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-04-22 12:43:22 +0200
committerDanilo M. <danix@danix.xyz>2026-04-22 12:43:22 +0200
commit5b476f8905f411768e23cb01d577a60e5a5fd725 (patch)
tree0a08cc83d809dbea714f52826e822501ee7c0165 /themes/danix-xyz-hacker/layouts/shortcodes
parent082e9246ffe453031894d32d3cee9d5d1bf2b67a (diff)
downloaddanixxyz-5b476f8905f411768e23cb01d577a60e5a5fd725.tar.gz
danixxyz-5b476f8905f411768e23cb01d577a60e5a5fd725.zip
chore: extract theme into git submodule (danix2-hugo-theme)
Diffstat (limited to 'themes/danix-xyz-hacker/layouts/shortcodes')
-rw-r--r--themes/danix-xyz-hacker/layouts/shortcodes/actions.html19
-rw-r--r--themes/danix-xyz-hacker/layouts/shortcodes/contact.html65
-rw-r--r--themes/danix-xyz-hacker/layouts/shortcodes/dropcap.html1
-rw-r--r--themes/danix-xyz-hacker/layouts/shortcodes/em.html1
-rw-r--r--themes/danix-xyz-hacker/layouts/shortcodes/gallery.html12
-rw-r--r--themes/danix-xyz-hacker/layouts/shortcodes/gravatar.html17
-rw-r--r--themes/danix-xyz-hacker/layouts/shortcodes/image.html23
-rw-r--r--themes/danix-xyz-hacker/layouts/shortcodes/quote.html15
-rw-r--r--themes/danix-xyz-hacker/layouts/shortcodes/strike.html1
-rw-r--r--themes/danix-xyz-hacker/layouts/shortcodes/video.html37
10 files changed, 0 insertions, 191 deletions
diff --git a/themes/danix-xyz-hacker/layouts/shortcodes/actions.html b/themes/danix-xyz-hacker/layouts/shortcodes/actions.html
deleted file mode 100644
index 7badab3..0000000
--- a/themes/danix-xyz-hacker/layouts/shortcodes/actions.html
+++ /dev/null
@@ -1,19 +0,0 @@
-{{- $url := .Get "url" -}}
-{{- $desc := .Get "desc" | default "Download" -}}
-{{- $outclass := .Get "outclass" | default "" -}}
-{{- $inclass := .Get "inclass" | default "" -}}
-
-{{- if $url -}}
-<div class="my-6 {{ $outclass }}">
- <a
- href="{{ $url }}"
- class="inline-flex items-center gap-2 px-4 py-2 rounded border border-accent/30 text-accent font-medium hover:border-accent/50 hover:bg-accent/10 transition-colors {{ $inclass }}"
- download
- >
- <i data-feather="download" class="w-4 h-4"></i>
- {{ $desc }}
- </a>
-</div>
-{{- else -}}
- {{- errorf "actions shortcode: 'url' parameter is required" -}}
-{{- end -}}
diff --git a/themes/danix-xyz-hacker/layouts/shortcodes/contact.html b/themes/danix-xyz-hacker/layouts/shortcodes/contact.html
deleted file mode 100644
index 6c5748f..0000000
--- a/themes/danix-xyz-hacker/layouts/shortcodes/contact.html
+++ /dev/null
@@ -1,65 +0,0 @@
-<form id="contact-form" x-data="contactForm()" @submit.prevent="submitContactForm" class="space-y-6">
- <!-- Name Field -->
- <div>
- <label for="name" class="block text-sm font-medium text-text mb-2">
- {{ i18n "name" }}
- </label>
- <input
- id="name"
- type="text"
- x-model="formData.name"
- required
- class="w-full px-4 py-2 bg-bg border border-border/50 rounded-lg text-text placeholder-text-dim focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition-colors"
- :aria-busy="isSubmitting"
- />
- </div>
-
- <!-- Email Field -->
- <div>
- <label for="email" class="block text-sm font-medium text-text mb-2">
- {{ i18n "email" }}
- </label>
- <input
- id="email"
- type="email"
- x-model="formData.email"
- required
- class="w-full px-4 py-2 bg-bg border border-border/50 rounded-lg text-text placeholder-text-dim focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition-colors"
- :aria-busy="isSubmitting"
- />
- </div>
-
- <!-- Message Field -->
- <div>
- <label for="message" class="block text-sm font-medium text-text mb-2">
- {{ i18n "message" }}
- </label>
- <textarea
- id="message"
- x-model="formData.message"
- rows="5"
- required
- class="w-full px-4 py-2 bg-bg border border-border/50 rounded-lg text-text placeholder-text-dim focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition-colors resize-none"
- :aria-busy="isSubmitting"
- ></textarea>
- </div>
-
- <!-- Status Message -->
- <div
- x-show="statusMessage"
- x-text="statusMessage"
- :class="statusClass"
- class="px-4 py-3 rounded-lg text-sm transition-all"
- ></div>
-
- <!-- Submit Button -->
- <button
- type="submit"
- :disabled="isSubmitting"
- class="w-full px-4 py-2 bg-accent text-bg font-medium rounded-lg hover:bg-accent/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"
- >
- <span x-show="!isSubmitting">{{ i18n "submit" }}</span>
- <span x-show="isSubmitting">{{ i18n "sending" }}</span>
- </button>
-</form>
-
diff --git a/themes/danix-xyz-hacker/layouts/shortcodes/dropcap.html b/themes/danix-xyz-hacker/layouts/shortcodes/dropcap.html
deleted file mode 100644
index 6114678..0000000
--- a/themes/danix-xyz-hacker/layouts/shortcodes/dropcap.html
+++ /dev/null
@@ -1 +0,0 @@
-<span class="text-2xl font-bold first-letter:text-3xl">{{ .Inner }}</span>
diff --git a/themes/danix-xyz-hacker/layouts/shortcodes/em.html b/themes/danix-xyz-hacker/layouts/shortcodes/em.html
deleted file mode 100644
index a3a096c..0000000
--- a/themes/danix-xyz-hacker/layouts/shortcodes/em.html
+++ /dev/null
@@ -1 +0,0 @@
-<em>{{ .Inner }}</em>
diff --git a/themes/danix-xyz-hacker/layouts/shortcodes/gallery.html b/themes/danix-xyz-hacker/layouts/shortcodes/gallery.html
deleted file mode 100644
index b66c327..0000000
--- a/themes/danix-xyz-hacker/layouts/shortcodes/gallery.html
+++ /dev/null
@@ -1,12 +0,0 @@
-{{- $cols := .Get "cols" | default "2" -}}
-
-<div class="my-8 grid gap-4" style="grid-template-columns: repeat({{ $cols }}, 1fr)">
- {{- range $line := strings.Split .Inner "\n" -}}
- {{- if strings.Contains $line "![" -}}
- {{- $image := strings.TrimSpace $line -}}
- {{- if $image -}}
- {{ $image | markdownify | safeHTML }}
- {{- end -}}
- {{- end -}}
- {{- end -}}
-</div>
diff --git a/themes/danix-xyz-hacker/layouts/shortcodes/gravatar.html b/themes/danix-xyz-hacker/layouts/shortcodes/gravatar.html
deleted file mode 100644
index 3a1ebcc..0000000
--- a/themes/danix-xyz-hacker/layouts/shortcodes/gravatar.html
+++ /dev/null
@@ -1,17 +0,0 @@
-{{- $email := .Get "email" -}}
-{{- $size := .Get "size" | default "256" | int -}}
-{{- $alt := .Get "alt" | default "User avatar" -}}
-{{- $class := .Get "class" | default "w-32 h-32 rounded-full" -}}
-
-{{- if $email -}}
- {{- $hash := md5 (strings.TrimSpace (strings.ToLower $email)) -}}
- {{- $gravatarURL := printf "https://www.gravatar.com/avatar/%s?s=%d&d=identicon" $hash $size -}}
- <img
- src="{{ $gravatarURL }}"
- alt="{{ $alt }}"
- class="{{ $class }}"
- loading="lazy"
- />
-{{- else -}}
- {{- errorf "gravatar shortcode: 'email' parameter is required" -}}
-{{- end -}}
diff --git a/themes/danix-xyz-hacker/layouts/shortcodes/image.html b/themes/danix-xyz-hacker/layouts/shortcodes/image.html
deleted file mode 100644
index 84dec3f..0000000
--- a/themes/danix-xyz-hacker/layouts/shortcodes/image.html
+++ /dev/null
@@ -1,23 +0,0 @@
-{{- $src := .Get "src" -}}
-{{- $alt := .Get "alt" | default "Image" -}}
-{{- $caption := .Get "caption" -}}
-{{- $class := .Get "class" | default "w-full h-auto rounded-lg border border-border" -}}
-{{- $link := .Get "link" -}}
-{{- $figureClass := .Get "figure-class" -}}
-
-{{- if or $src .Inner -}}
- <figure class="my-8{{- with $figureClass }} {{ . }}{{- end -}}">
- {{- if .Inner -}}
- {{- .Inner -}}
- {{- else -}}
- {{- if $link -}}<a href="{{ $link }}">{{- end -}}
- <img src="{{ $src }}" alt="{{ $alt }}" class="{{ $class }}" loading="lazy" />
- {{- if $link -}}</a>{{- end -}}
- {{- end -}}
- {{- if $caption -}}
- <figcaption class="mt-3 text-center text-sm text-text-dim italic">{{ $caption }}</figcaption>
- {{- end -}}
- </figure>
-{{- else -}}
- {{- errorf "image shortcode: 'src' parameter or inner content is required" -}}
-{{- end -}}
diff --git a/themes/danix-xyz-hacker/layouts/shortcodes/quote.html b/themes/danix-xyz-hacker/layouts/shortcodes/quote.html
deleted file mode 100644
index 1ed5c3c..0000000
--- a/themes/danix-xyz-hacker/layouts/shortcodes/quote.html
+++ /dev/null
@@ -1,15 +0,0 @@
-{{- $source := .Get "source" -}}
-{{- $src := .Get "src" -}}
-
-<blockquote class="my-8 pl-6 border-l-4 border-accent/50 italic text-text-dim">
- <p class="text-lg">{{ .Inner }}</p>
- {{- if $source -}}
- <footer class="mt-4 text-sm not-italic text-text-dim">
- {{- if $src -}}
- — <a href="{{ $src }}" class="text-accent hover:underline">{{ $source }}</a>
- {{- else -}}
- — {{ $source }}
- {{- end -}}
- </footer>
- {{- end -}}
-</blockquote>
diff --git a/themes/danix-xyz-hacker/layouts/shortcodes/strike.html b/themes/danix-xyz-hacker/layouts/shortcodes/strike.html
deleted file mode 100644
index 275b7c1..0000000
--- a/themes/danix-xyz-hacker/layouts/shortcodes/strike.html
+++ /dev/null
@@ -1 +0,0 @@
-<s>{{ .Inner }}</s>
diff --git a/themes/danix-xyz-hacker/layouts/shortcodes/video.html b/themes/danix-xyz-hacker/layouts/shortcodes/video.html
deleted file mode 100644
index 1e2645d..0000000
--- a/themes/danix-xyz-hacker/layouts/shortcodes/video.html
+++ /dev/null
@@ -1,37 +0,0 @@
-{{- $src := .Get "src" -}}
-{{- $id := .Get "id" -}}
-{{- $title := .Get "title" | default "Video" -}}
-{{- $class := .Get "class" | default "" -}}
-
-{{- if $id -}}
- <div class="my-6{{- with $class }} {{ . }}{{- end -}}">
- <iframe
- class="w-full aspect-video"
- src="https://www.youtube.com/embed/{{ $id }}"
- title="{{ $title }}"
- allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
- allowfullscreen
- ></iframe>
- </div>
-{{- else if $src -}}
- {{- $ext := $src | path.Ext -}}
- {{- $filetype := slicestr $ext 1 -}}
- {{- $videoURL := $src -}}
- {{- $resource := .Page.Resources.GetMatch $src -}}
- {{- if $resource -}}{{- $videoURL = $resource.RelPermalink -}}{{- end -}}
- <video
- {{- with $class }} class="{{ . }}"{{ end }}
- controls
- preload="auto"
- playsinline
- {{- with .Get "width" }} width="{{ . }}"{{ end }}
- {{- with .Get "height" }} height="{{ . }}"{{ end }}
- {{- if eq (.Get "autoplay") "true" }} autoplay{{ end }}
- {{- if eq (.Get "loop") "true" }} loop{{ end }}
- {{- if eq (.Get "muted") "true" }} muted{{ end }}
- >
- <source src="{{ $videoURL }}" type="video/{{ $filetype }}">
- </video>
-{{- else -}}
- {{- errorf "video shortcode: either 'src' or 'id' parameter is required" -}}
-{{- end -}}