mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-12 18:15:31 +00:00
BREAKING CHANGE Module paths moved to `github.com/HugoBlox/kit` with new names: - core `blox-tailwind` → `blox` - analytics → `analytics` - netlify → `integrations/netlify` - slides (reveal) → `slides` Update go.mod, module.yaml/params, scripts, tests, and v0.11 migration guide accordingly.
36 lines
967 B
HTML
36 lines
967 B
HTML
{{/*
|
|
Docs: https://docs.hugoblox.com/content/writing-markdown-latex/
|
|
*/}}
|
|
|
|
{{- $url := .Get "url" -}}
|
|
{{- $is_external := strings.HasPrefix $url "http" -}}
|
|
{{- $url = cond (strings.HasPrefix $url "/") ($url | relURL) $url -}}
|
|
|
|
{{- $icon := .Get "icon" -}}
|
|
{{- $title := .Get "title" -}}
|
|
{{- $subtitle := .Get "subtitle" -}}
|
|
|
|
<a
|
|
class="hb-card group"
|
|
{{- if $url -}}
|
|
href="{{ $url }}" {{ with $is_external }}target="_blank" rel="noreferrer"{{ end -}}
|
|
{{- end -}}
|
|
>
|
|
|
|
{{/* Adjust padding depending on content */}}
|
|
{{- $padding := "p-4" -}}
|
|
{{- with $subtitle -}}
|
|
{{- $padding = "pt-4 px-4" -}}
|
|
{{- end -}}
|
|
|
|
<span class="hb-card-title {{ $padding }}">
|
|
{{- with $icon }}
|
|
{{ partial "functions/get_icon" (dict "name" $icon "attributes" "style=\"height: 1em; width: 1em;\"") -}}
|
|
{{- end -}}
|
|
{{- $title -}}
|
|
</span>
|
|
{{- with $subtitle -}}
|
|
<div class="hb-card-subtitle">{{- $subtitle | markdownify -}}</div>
|
|
{{- end -}}
|
|
</a>
|