Some checks failed
Build and Deploy / build-and-deploy (push) Has been cancelled
Stop concatenating post title into base_title in route context. Build proper "Post Title — Site Title" format in meta component instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
58 lines
2.7 KiB
Plaintext
58 lines
2.7 KiB
Plaintext
;; Blog post detail components
|
|
|
|
(defcomp ~blog-detail-edit-link (&key href hx-select)
|
|
(a :href href :hx-get href :hx-target "#main-panel"
|
|
:hx-select hx-select :hx-swap "outerHTML" :hx-push-url "true"
|
|
:class "inline-block px-3 py-1 rounded-full text-sm font-semibold bg-stone-700 text-white hover:bg-stone-800 transition-colors"
|
|
(i :class "fa fa-pencil mr-1") " Edit"))
|
|
|
|
(defcomp ~blog-detail-draft (&key publish-requested edit-html)
|
|
(div :class "flex items-center justify-center gap-2 mb-3"
|
|
(span :class "inline-block px-3 py-1 rounded-full text-sm font-semibold bg-amber-100 text-amber-800" "Draft")
|
|
(when publish-requested (span :class "inline-block px-3 py-1 rounded-full text-sm font-semibold bg-blue-100 text-blue-800" "Publish requested"))
|
|
(raw! edit-html)))
|
|
|
|
(defcomp ~blog-detail-like (&key like-url hx-headers heart)
|
|
(div :class "absolute top-2 right-2 z-10 text-8xl md:text-6xl"
|
|
(button :hx-post like-url :hx-swap "outerHTML"
|
|
:hx-headers hx-headers :class "cursor-pointer" heart)))
|
|
|
|
(defcomp ~blog-detail-excerpt (&key excerpt)
|
|
(div :class "w-full text-center italic text-3xl p-2" excerpt))
|
|
|
|
(defcomp ~blog-detail-chrome (&key like-html excerpt-html at-bar-html)
|
|
(<> (raw! like-html) (raw! excerpt-html) (div :class "hidden md:block" (raw! at-bar-html))))
|
|
|
|
(defcomp ~blog-detail-main (&key draft-html chrome-html feature-image html-content)
|
|
(<> (article :class "relative"
|
|
(raw! draft-html) (raw! chrome-html)
|
|
(when feature-image (div :class "mb-3 flex justify-center"
|
|
(img :src feature-image :alt "" :class "rounded-lg w-full md:w-3/4 object-cover")))
|
|
(when html-content (div :class "blog-content p-2" (raw! html-content))))
|
|
(div :class "pb-8")))
|
|
|
|
(defcomp ~blog-meta (&key robots page-title desc canonical og-type og-title image twitter-card twitter-title)
|
|
(<>
|
|
(meta :name "robots" :content robots)
|
|
(title page-title)
|
|
(meta :name "description" :content desc)
|
|
(when canonical (link :rel "canonical" :href canonical))
|
|
(meta :property "og:type" :content og-type)
|
|
(meta :property "og:title" :content og-title)
|
|
(meta :property "og:description" :content desc)
|
|
(when canonical (meta :property "og:url" :content canonical))
|
|
(when image (meta :property "og:image" :content image))
|
|
(meta :name "twitter:card" :content twitter-card)
|
|
(meta :name "twitter:title" :content twitter-title)
|
|
(meta :name "twitter:description" :content desc)
|
|
(when image (meta :name "twitter:image" :content image))))
|
|
|
|
(defcomp ~blog-home-main (&key html-content)
|
|
(article :class "relative" (div :class "blog-content p-2" (raw! html-content))))
|
|
|
|
(defcomp ~blog-admin-empty ()
|
|
(div :class "pb-8"))
|
|
|
|
(defcomp ~blog-settings-empty ()
|
|
(div :class "max-w-2xl mx-auto px-4 py-6"))
|