Files
docker-docs/layouts/shortcodes/button.html
Arthur 9eff1ba5fc theme: extract more styles (#22734)
Extract shared styling into appropriate utilities.
Improve toc width.
2025-05-30 09:20:56 -07:00

13 lines
387 B
HTML

{{ $text := .Get "text" }}
{{ $url := .Get "url" }}
{{- if (strings.HasPrefix $url "http") -}}
{{ $url = $url | safeURL }}
{{- else if (strings.FindRE `([^_]|^)index.md` $url 1) -}}
{{ $url = ref .Page (strings.Replace $url "index.md" "_index.md") }}
{{- else -}}
{{ $url = ref .Page $url }}
{{- end -}}
<div class="button not-prose">
<a href="{{ $url }}">{{ $text }}</a>
</div>