Skip to content

Commit

Permalink
feat: add hextra hero-section shortcode (#390)
Browse files Browse the repository at this point in the history
* Implement hextra hero-section

* Implement header size

* Update layouts/shortcodes/hextra/hero-section.html

* Update layouts/shortcodes/hextra/hero-section.html

* Update layouts/shortcodes/hextra/hero-section.html

* Update layouts/shortcodes/hextra/hero-section.html

---------

Co-authored-by: Xin <[email protected]>
  • Loading branch information
fmunteanu and imfing authored Dec 10, 2024
1 parent fe2271b commit 0c90c1a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions layouts/shortcodes/hextra/hero-section.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{- $style := .Get "style" -}}
{{- $heading := int (strings.TrimPrefix "h" (.Get "heading" | default "h2")) -}}
{{- $size := cond (ge $heading 4) "xl" (cond (eq $heading 3) "2xl" "4xl") -}}

<h{{ $heading }}
class="not-prose hx-text-{{ $size }} hx-font-bold hx-leading-none hx-tracking-tighter md:hx-text-3xl hx-py-2 hx-bg-clip-text hx-text-transparent hx-bg-gradient-to-r hx-from-gray-900 hx-to-gray-600 dark:hx-from-gray-100 dark:hx-to-gray-400"
{{ with $style }}style="{{ . | safeCSS }}"{{ end }}
>
{{ .Inner | markdownify }}
</h{{ $heading }}>

0 comments on commit 0c90c1a

Please sign in to comment.