Merge branch 'dev' into feature/callout-tailwind

This commit is contained in:
ZhenShuo Leo
2025-12-23 01:21:40 +08:00
58 changed files with 1719 additions and 923 deletions

View File

@@ -0,0 +1,10 @@
{{- $title := or .Attributes.title "" -}}
{{- $lang := or .Type "text" -}}
<div class="highlight-wrapper">
{{- with $title -}}
<div class="codeblock-title">
{{- $title -}}
</div>
{{- end -}}
{{- transform.Highlight .Inner $lang .Options -}}
</div>

View File

@@ -1,11 +1,30 @@
<a
href="{{ .Destination | safeURL }}"
{{- with .Title -}}
title="{{ . }}"
{{- end }}
{{- if or (strings.HasPrefix .Destination "http:") (strings.HasPrefix .Destination "https:") }}
target="_blank"
{{ end }}>
{{/* From Hugo, Apache v2 license
https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/_markup/render-link.html
*/}}
{{- $u := urls.Parse .Destination -}}
{{- $href := $u.String -}}
{{- if strings.HasPrefix $u.String "#" -}}
{{- $href = printf "%s#%s" .PageInner.RelPermalink $u.Fragment -}}
{{- else if and $href (not $u.IsAbs) -}}
{{- $path := strings.TrimPrefix "./" $u.Path -}}
{{- with or
($.PageInner.GetPage $path)
($.PageInner.Resources.Get $path)
(resources.Get $path)
-}}
{{- $href = .RelPermalink -}}
{{- with $u.RawQuery -}}
{{- $href = printf "%s?%s" $href . -}}
{{- end -}}
{{- with $u.Fragment -}}
{{- $href = printf "%s#%s" $href . -}}
{{- end -}}
{{- end -}}
{{- end -}}
<a href="{{ $href }}" {{ with .Title }}title="{{ . }}"{{ end }}
{{- if or (strings.HasPrefix .Destination "http:") (strings.HasPrefix .Destination "https:") }} target="_blank"{{ end }}>
{{- .Text | safeHTML -}}
</a>
{{- /* Trim EOF */ -}}

View File

@@ -11,7 +11,7 @@
{{ $bodyLayout := "flex flex-col h-screen m-auto leading-7 max-w-7xl px-6 sm:px-14 md:px-24 lg:px-32" }}
{{ $bodyColor := "text-lg bg-neutral text-neutral-900 dark:bg-neutral-800 dark:text-neutral" }}
{{ $bodyScrollbar := "scrollbar-thin scrollbar-track-neutral-200 scrollbar-thumb-neutral-400 dark:scrollbar-track-neutral-800 dark:scrollbar-thumb-neutral-600" }}
<body class="{{ $bodyLayout }} {{ $bodyColor }} {{ $bodyScrollbar }}">
<body class="{{ $bodyLayout }} {{ $bodyColor }} {{ if site.Params.enableStyledScrollbar | default true }}{{ $bodyScrollbar }}{{ end }}">
<div id="the-top" class="absolute flex self-center">
<a
class="px-3 py-1 text-sm -translate-y-8 rounded-b-lg bg-primary-200 focus:translate-y-0 dark:bg-neutral-600"

View File

@@ -51,7 +51,7 @@
</div>
</div>
{{ end }}
<div class="min-w-0 min-h-0 max-w-prose">
<div class="min-w-0 min-h-0 max-w-prose w-full">
{{ .Content }}
</div>
</section>