Files
blowfish/layouts/partials/cta-button.html
T
Nuno CoraçãoandClaude Fable 5 09f0573749 ✨ v3 theme: glass UI, landing layout, a11y, perf, print styles
Floating glass header with ⌘K search, landing homepage layout with
hero image and GitHub-stars CTA, background canvas with dissolving
heroes, burufugu colour scheme, movie-quote 404, taxonomy pills,
keyboard/ARIA accessibility across menus, search and tabs, idle-
loaded third-party scripts, and dedicated print styles.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-17 20:19:02 +01:00

36 lines
1.6 KiB
HTML

{{- $url := .url | default "#" -}}
{{- $label := .label | default "Learn more" -}}
{{- $style := .style | default "primary" -}}
{{- $github := .github -}}
{{- $stars := "" -}}
{{- with $github -}}
{{- with try (resources.GetRemote (printf "https://api.github.com/repos/%s" .)) -}}
{{- with .Value -}}
{{- with .Content | transform.Unmarshal -}}
{{- $count := int .stargazers_count -}}
{{- if ge $count 1000 -}}
{{- $stars = replace (printf "%.1fk" (div (float $count) 1000)) ".0k" "k" -}}
{{- else -}}
{{- $stars = printf "%d" $count -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
<a
class="not-prose inline-flex items-center gap-2 rounded-xl px-5 py-3 font-semibold transition focus-visible:outline-2 focus-visible:outline-offset-2 {{ if eq $style "outline" }}border border-neutral-300 bg-white text-neutral-800 hover:border-primary-400 hover:text-primary-600 dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-100 dark:hover:text-primary-400{{ else }}bg-primary-600 text-white shadow-lg shadow-primary-500/20 hover:-translate-y-0.5 hover:bg-primary-500 focus-visible:outline-primary-600{{ end }}"
href="{{ $url | safeURL }}">
{{- if $github }}
{{ partial "icon.html" "github" }}
{{ end -}}
{{ $label | markdownify }}
{{- if $stars }}
<span class="inline-flex items-center gap-1 rounded-full border border-neutral-300/80 px-2 py-0.5 text-xs font-bold text-neutral-500 dark:border-neutral-600/80 dark:text-neutral-400">
{{ partial "icon.html" "star" }}
{{ $stars }}
</span>
{{- else }}
{{ partial "icon.html" "link" }}
{{- end }}
</a>