Compare commits

...

3 Commits

Author SHA1 Message Date
David Legrand
a28be8ffa6
Merge f66c915d5b499ba53d8253b99807fe4a4c654e46 into 0c90c1aa500dd1da473c474202b38fb82bcb5188 2024-12-12 01:14:51 +00:00
Floren Munteanu
0c90c1aa50
feat: add hextra hero-section shortcode (#390)
Some checks failed
Deploy Hugo site to Pages / build (push) Has been cancelled
Deploy Hugo site to Pages / deploy (push) Has been cancelled
* 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 <fuxin1997@gmail.com>
2024-12-10 23:58:36 +00:00
David Legrand
f66c915d5b feat: add sectionsTitles param
The user can define a per section title in params, used in section pages. If none is defined, the default title is used.
2024-02-27 07:15:57 +01:00
2 changed files with 14 additions and 0 deletions

View File

@ -10,6 +10,10 @@
<title>
{{- if .IsHome -}}
{{ .Site.Title -}}
{{ else if eq .Kind "page" -}}
{{ with .Title }}{{ . }} {{ end -}}
{{ $sectionTitle := index .Site.Params.sectionsTitles .Section }}
{{ $sectionTitle | default .Site.Title }}
{{ else -}}
{{ with .Title }}{{ . }} {{ end -}}
{{ .Site.Title -}}

View File

@ -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 }}>