Implement header size

This commit is contained in:
Floren Munteanu 2024-05-17 15:29:39 -04:00
parent 9e684fa313
commit 368c20e935

View File

@ -1,8 +1,10 @@
{{- $style := .Get "style" -}} {{- $style := .Get "style" -}}
{{- $header := int (strings.TrimPrefix "h" (.Get "header" | default "h2")) -}}
{{- $size := cond (ge $header 4) "xl" (cond (eq $header 3) "2xl" "4xl") -}}
<h2 <h{{ $header }}
class="not-prose hx-text-4xl 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" 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 }} {{ with $style }}style="{{ . | safeCSS }}"{{ end }}
> >
{{ .Inner | markdownify }} {{ .Inner | markdownify }}
</h2> </h{{ $header }}>