diff options
| author | eltrac <hi@eltr.ac> | 2026-04-07 14:53:17 +0800 |
|---|---|---|
| committer | eltrac <hi@eltr.ac> | 2026-04-07 14:53:17 +0800 |
| commit | 10431bd8f5ff71690ae4e5444e8d7894fd401ae5 (patch) | |
| tree | 62b7fd1b6c1f68d2804f380eb522bcebeb2c8d9f /layouts/_markup | |
| parent | 3e0edacc4a0cafa53ede57ebb6f0378c93f3123b (diff) | |
chore: move templates out of site repo
Diffstat (limited to 'layouts/_markup')
| -rw-r--r-- | layouts/_markup/render-blockquote.html | 30 | ||||
| -rw-r--r-- | layouts/_markup/render-heading.html | 12 | ||||
| -rw-r--r-- | layouts/_markup/render-image.html | 25 | ||||
| -rw-r--r-- | layouts/_markup/render-link.html | 6 | ||||
| -rw-r--r-- | layouts/_markup/render-table.html | 32 |
5 files changed, 0 insertions, 105 deletions
diff --git a/layouts/_markup/render-blockquote.html b/layouts/_markup/render-blockquote.html deleted file mode 100644 index 79f57a85..00000000 --- a/layouts/_markup/render-blockquote.html +++ /dev/null @@ -1,30 +0,0 @@ -{{ $emojis := dict - "caution" "đ¨" - "important" "âī¸" - "note" "âšī¸" - "tip" "đĄ" - "warning" "â ī¸" - "announcement" "đŖ" -}} - -{{ if eq .Type "alert" }} - <blockquote class="rounded-1 leading-[1.75] mx-0 px-5 - flex gap-3 my-2 alert-{{ .AlertType }}" - style="background-color: oklch(from var(--block-background-color) l c h / calc(alpha - 0.5))" - > - <div class="py-5"> - {{ with .AlertTitle }} - {{.}} - {{ else }} - {{ index $emojis .AlertType }} - {{ end }} - </div> - <div> - {{ .Text }} - </div> - </blockquote> -{{ else }} - <blockquote class="text-secondary p-0 m-0 ml-[1em]"> - {{ .Text }} - </blockquote> -{{ end }} diff --git a/layouts/_markup/render-heading.html b/layouts/_markup/render-heading.html deleted file mode 100644 index 52b2f3ff..00000000 --- a/layouts/_markup/render-heading.html +++ /dev/null @@ -1,12 +0,0 @@ -{{ $size := index (dict - "1" "text-[1.5em] font-extrabold" - "2" "text-[1.25em] font-extrabold" - "3" "text-[1.125em] font-bold" - "4" "text-[1em] font-bold" - "5" "text-[0.9em] font-bold" - "6" "text-[0.875em]") (printf "%d" .Level) }} -<h{{ .Level }} - id="{{ .Anchor }}" - class="{{ $size }} {{ with .Attributes.class }} {{ . }}{{ end }}"> - {{- .Text -}} -</h{{ .Level }}> diff --git a/layouts/_markup/render-image.html b/layouts/_markup/render-image.html deleted file mode 100644 index 49c9fcee..00000000 --- a/layouts/_markup/render-image.html +++ /dev/null @@ -1,25 +0,0 @@ -{{- $src := .Destination -}} -{{- $alt := .Text | default "" -}} -{{- $caption := .Title | default "" -}} -{{- $class := .Attributes.class | default "" -}} - -{{- if and (not (strings.HasPrefix $src "https://")) (not (strings.HasPrefix $src "http://")) -}} - {{- if not (strings.HasPrefix $src "/") -}} - {{- $src = printf "%s/%s%s" site.Params.assetBaseUrl .Page.File.Dir $src -}} - {{- else -}} - {{- $src = printf "%s%s" site.Params.assetBaseUrl $src -}} - {{- end -}} -{{- end -}} - -<figure> - <img - class="lazy {{ $class }}" loading="lazy" - src="{{ $src }}" alt="{{ $alt }}" - data-libra - /> - {{- if $caption }} - <figcaption> - <h4>{{ $caption | markdownify }}</h4> - </figcaption> - {{- end }} -</figure> diff --git a/layouts/_markup/render-link.html b/layouts/_markup/render-link.html deleted file mode 100644 index 2e8d32f7..00000000 --- a/layouts/_markup/render-link.html +++ /dev/null @@ -1,6 +0,0 @@ -{{ $url := .Destination | safeURL }} -{{ if or (strings.HasPrefix $url "http://") (strings.HasPrefix $url "https://") }} - <a href="{{ $url }}" class="external-link" target="_blank" rel="noopener noreferrer">{{ .Text }}</a> -{{ else }} - <a href="{{ $url }}">{{ .Text }}</a> -{{ end }} diff --git a/layouts/_markup/render-table.html b/layouts/_markup/render-table.html deleted file mode 100644 index 010942f0..00000000 --- a/layouts/_markup/render-table.html +++ /dev/null @@ -1,32 +0,0 @@ -<div class="overflow-x-auto"> - <table class="border-collapse w-max min-w-full table-fixed - b-t-2 b-t-solid b-t-[var(--border-color)]" - style="-webkit-overflow-scrolling: touch;"> - {{- if .THead }} - <thead> - {{- range .THead }} - <tr class="b-t-1 b-t-solid b-t-[var(--border-color)]"> - {{- range . }} - <th - class="max-w-[200px] py-2 px-4 leading-snug whitespace-normal break-words" - {{ with .Alignment }} style="text-align:{{ . }}"{{ end }} - >{{ .Text | safeHTML }}</th> - {{- end }} - </tr> - {{- end }} - </thead> - {{- end }} - <tbody> - {{- range .TBody }} - <tr class="b-t-1 b-t-solid b-t-[var(--border-color)]"> - {{- range . }} - <td - class="max-w-[200px] py-2 px-4 leading-snug whitespace-normal break-words" - {{ with .Alignment }} style="text-align:{{ . }}"{{ end }} - >{{ .Text | safeHTML }}</td> - {{- end }} - </tr> - {{- end }} - </tbody> - </table> -</div> |
