diff options
| author | Danilo M. <danix@danix.xyz> | 2026-04-15 16:38:12 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-04-15 16:38:12 +0200 |
| commit | 231d29bf26820ca058dec57c06345943ca6dbbf2 (patch) | |
| tree | b60f6e4afd1bf88bcfeb02b6d28f00cc1806ccc9 /themes/danix-xyz-hacker/shortcodes | |
| parent | 46065a5077f113ab772e3a46f83748efe5f81caf (diff) | |
| download | danixxyz-231d29bf26820ca058dec57c06345943ca6dbbf2.tar.gz danixxyz-231d29bf26820ca058dec57c06345943ca6dbbf2.zip | |
Fix shortcode location: move from shortcodes/ to layouts/shortcodes/
Hugo v0.156.0+ requires shortcodes to be in layouts/shortcodes/ directory.
Moved all shortcodes (gravatar, image, gallery, contact-form) to correct location.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Diffstat (limited to 'themes/danix-xyz-hacker/shortcodes')
| -rw-r--r-- | themes/danix-xyz-hacker/shortcodes/contact-form.html | 114 | ||||
| -rw-r--r-- | themes/danix-xyz-hacker/shortcodes/gallery.html | 12 | ||||
| -rw-r--r-- | themes/danix-xyz-hacker/shortcodes/gravatar.html | 17 | ||||
| -rw-r--r-- | themes/danix-xyz-hacker/shortcodes/image.html | 22 |
4 files changed, 0 insertions, 165 deletions
diff --git a/themes/danix-xyz-hacker/shortcodes/contact-form.html b/themes/danix-xyz-hacker/shortcodes/contact-form.html deleted file mode 100644 index 19884aa..0000000 --- a/themes/danix-xyz-hacker/shortcodes/contact-form.html +++ /dev/null @@ -1,114 +0,0 @@ -{{- $contactFormData := dict -}} - -<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> - -<script> -document.addEventListener('alpine:init', () => { - Alpine.data('contactForm', () => ({ - formData: { - name: '', - email: '', - message: '' - }, - isSubmitting: false, - statusMessage: '', - statusClass: '', - - async submitContactForm() { - this.isSubmitting = true; - this.statusMessage = ''; - this.statusClass = ''; - - try { - const response = await fetch('/contact.php', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify(this.formData) - }); - - const data = await response.json(); - - if (response.ok) { - this.statusMessage = '{{ i18n "form_success" | default "Message sent successfully!" }}'; - this.statusClass = 'bg-green-100 text-green-800 border border-green-300'; - this.formData = { name: '', email: '', message: '' }; - } else { - this.statusMessage = data.error || '{{ i18n "form_error" | default "An error occurred. Please try again." }}'; - this.statusClass = 'bg-red-100 text-red-800 border border-red-300'; - } - } catch (error) { - this.statusMessage = '{{ i18n "form_error" | default "An error occurred. Please try again." }}'; - this.statusClass = 'bg-red-100 text-red-800 border border-red-300'; - console.error('Form submission error:', error); - } finally { - this.isSubmitting = false; - } - } - })); -}); -</script> diff --git a/themes/danix-xyz-hacker/shortcodes/gallery.html b/themes/danix-xyz-hacker/shortcodes/gallery.html deleted file mode 100644 index b66c327..0000000 --- a/themes/danix-xyz-hacker/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 "