added new shortcodes to support feature pages

This commit is contained in:
Chaoming Li 2024-12-04 16:47:57 +11:00
parent c856c6b355
commit 89c6d73598
6 changed files with 92 additions and 1 deletions

View file

@ -12,7 +12,7 @@
}
</style>
<div class="absolute inset-x-0 top-0 h-96 gradient-bg opacity-75"></div>
<div class="relative pt-24 pb-32 sm:pt-32">
<div class="relative pt-24 pb-16 sm:pt-32">
<div class="mx-auto max-w-7xl px-6 lg:px-8">
<div class="mx-auto max-w-2xl text-center">
{{ with .Params.badge }}

View file

@ -0,0 +1,22 @@
{{- $iconClass := printf "w-%s h-%s" (.size | default "6") (.size | default "6") -}}
{{- $color := .color | default "#000000" -}}
<svg class="{{ $iconClass }}" style="color: {{ $color }};" fill="none" stroke="currentColor" viewBox="0 0 24 24">
{{- if eq .name "chart" -}}
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"></path>
{{- else if eq .name "attribution" -}}
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"></path>
{{- else if eq .name "roi" -}}
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
{{- else if eq .name "check" -}}
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path>
{{- else if eq .name "analytics" -}}
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 8v8m-4-5v5m-4-2v2m-2 4h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"></path>
{{- else if eq .name "funnel" -}}
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 4h18M5 8h14M7 12h10M9 16h6M11 20h2"></path>
{{- else if eq .name "target" -}}
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
{{- else if eq .name "custom" -}}
{{ .path | safeHTML }}
{{- end -}}
</svg>

View file

@ -0,0 +1,25 @@
{{ $title := .Get "title" }}
{{ $subtitle := .Get "subtitle" }}
<div class="text-center mb-16">
<h2 class="text-3xl font-bold mb-4">{{ $title }}</h2>
<p class="text-xl text-gray-600">{{ $subtitle }}</p>
</div>
<div class="grid grid-cols-1 md:grid-cols-3 gap-8">
{{ range $index := (seq 1 10) }}
{{ $benefit := printf "benefit%d" $index }}
{{ with $.Get $benefit }}
{{ $parts := split . "|" }}
{{ if ge (len $parts) 4 }}
<div class="p-6 bg-white rounded-xl shadow-lg hover:shadow-xl transition-shadow">
<div class="w-12 h-12 rounded-lg flex items-center justify-center mb-4" style="background-color: {{ index $parts 1 }}15;">
{{ partial "icons" (dict "name" (index $parts 0) "color" (index $parts 1) "size" "6") }}
</div>
<h3 class="text-xl font-bold mb-2">{{ index $parts 2 }}</h3>
<p class="text-gray-600">{{ index $parts 3 }}</p>
</div>
{{ end }}
{{ end }}
{{ end }}
</div>

View file

@ -0,0 +1,15 @@
<div class="not-prose">
<div class="bg-white rounded-2xl shadow-xl overflow-hidden">
<div class="grid grid-cols-1 md:grid-cols-2">
<div class="p-8 md:p-12">
<div class="inline-block px-4 py-2 rounded-full text-sm font-semibold mb-6" style="background-color: {{ .Get 0 }}15; color: {{ .Get 0 }};">{{ .Get 1 }}</div>
<div class="text-3xl font-bold mb-4 !mt-0">{{ .Get 2 }}</div>
<div class="text-gray-600 mb-6">{{ .Get 3 }}</div>
<a href="{{ .Get 5 }}" class="inline-block px-6 py-3 text-white font-bold rounded-lg transition-colors hover:opacity-90 !no-underline !text-white" style="background-color: {{ .Get 0 }};">{{ .Get 4 }}</a>
</div>
<div class="p-8 md:p-12 flex items-center justify-center" style="background: linear-gradient(135deg, {{ .Get 0 }}03, {{ .Get 0 }}30);">
<img src="{{ .Get 6 }}" alt="{{ .Get 7 }}" class="max-w-[200px] !my-0 !rounded-none !shadow-none">
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,26 @@
{{ $title := .Get "title" }}
{{ $color := .Get "color" | default "#2563eb" }}
<div class="max-w-3xl mx-auto">
<h2 class="text-3xl font-bold text-center !mb-24">{{ $title }}</h2>
<div class="space-y-12">
{{ range $index := (seq 1 10) }}
{{ $feature := printf "feature%d" $index }}
{{ with $.Get $feature }}
{{ $parts := split . "|" }}
{{ if ge (len $parts) 2 }}
<div class="flex gap-6">
<div class="w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0" style="background-color: {{ $color }}15;">
{{ partial "icons" (dict "name" "check" "color" $color "size" "6") }}
</div>
<div>
<h3 class="text-2xl font-bold mb-3 !mt-0">{{ index $parts 0 }}</h3>
<p class="text-gray-600 text-lg leading-relaxed">{{ index $parts 1 }}</p>
</div>
</div>
{{ end }}
{{ end }}
{{ end }}
</div>
</div>

View file

@ -0,0 +1,3 @@
<div class="not-prose">
<img src="{{ .Get 0 }}" alt="{{ .Get 1 }}" class="w-full no-prose-img">
</div>