diff options
| author | Eltrac <hi@guhub.cn> | 2025-07-19 20:50:29 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-07-19 20:50:29 +0800 |
| commit | 127024f93473cd5cb86d1423c323068821d73d66 (patch) | |
| tree | 959b75b8d7856741708f75372aa0d98169e530ca | |
| parent | c185f5cd837f451ec85b34b09ccdccebe88734e0 (diff) | |
feat: smaller card text in home page
| -rw-r--r-- | layouts/_partials/home/latest-cards.html | 7 | ||||
| -rw-r--r-- | layouts/_partials/items/card.html | 3 | ||||
| -rw-r--r-- | uno.config.js | 1 |
3 files changed, 8 insertions, 3 deletions
diff --git a/layouts/_partials/home/latest-cards.html b/layouts/_partials/home/latest-cards.html index 220a0d94..c4c7a69c 100644 --- a/layouts/_partials/home/latest-cards.html +++ b/layouts/_partials/home/latest-cards.html @@ -6,11 +6,14 @@ {{- $paginator := .Paginate $cards.Pages 4 }} <!-- 对该部分内容进行分页 --> {{- range $paginator.Pages }} <div class="flex-shrink-0 w-[50%]"> - {{ partial "items/card" (dict "context" . "summary" true) }} + {{ partial "items/card" (dict + "context" . + "summary" true + "summaryClass" "text-base!") }} </div> {{- end }} </div> - <div style="margin: 1rem 0"> + <div class="py-4"> <a href="/cards" class="small-button" data-umami-event="➕ Click more cards link"> {{ T "moreLinks.cards" }} → diff --git a/layouts/_partials/items/card.html b/layouts/_partials/items/card.html index fb619fb5..01a3cfb8 100644 --- a/layouts/_partials/items/card.html +++ b/layouts/_partials/items/card.html @@ -1,5 +1,6 @@ {{ $ctx := .context }} {{ $showSummary := .summary }} +{{ $summaryClass := .summaryClass }} <div class="relative p-6 bg-white dark:bg-neutral-800 rounded-lg shadow-md border border-gray-200 dark:border-gray-700" style="view-transition-name: card-{{ $ctx.File.UniqueID }}"> <div class="card-header"> @@ -12,7 +13,7 @@ </h3> <div class="text-base m-0">{{ partial "components/tags" $ctx }}</div> </div> - <div class="mt-2 leading-loose markdown-body"> + <div class="{{ $summaryClass }} mt-2 leading-loose markdown-body"> {{ if $showSummary }}{{ $ctx.Summary }}{{ else }}{{ $ctx.Content }}{{ end }} </div> </div> diff --git a/uno.config.js b/uno.config.js index 26bd5ac3..53f2ec13 100644 --- a/uno.config.js +++ b/uno.config.js @@ -31,6 +31,7 @@ export default defineConfig({ }, safelist: [ 'text-sm', 'text-md', 'text-lg', 'text-xl', 'text-2xl', 'text-3xl', 'text-4xl', 'text-5xl', + 'text-base!', ...range(10, i => `opacity-${i * 10}`), ...rangeWithPrefixes(5, 'rotate', ['', '-']), |
