-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
101 additions
and
73 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,6 +122,9 @@ | |
|
||
# Pages widget | ||
|
||
- id: read_more | ||
translation: Read more | ||
|
||
- id: more_pages | ||
translation: See all | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,6 +122,9 @@ | |
|
||
# Pages widget | ||
|
||
- id: read_more | ||
translation: 阅读文章 | ||
|
||
- id: more_pages | ||
translation: 查看全部 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,25 @@ | ||
{{ define "main" }} | ||
|
||
<div class="max-w-prose mx-auto flex justify-left"> | ||
<div class="max-w-prose mx-auto flex justify-center"> | ||
<article class="prose prose-slate lg:prose-xl dark:prose-invert"> | ||
<h1 class="lg:text-6xl">{{ .Title }}</h1> | ||
{{ .Content }} | ||
</article> | ||
</div> | ||
|
||
<div class="max-w-prose mx-auto bg-white dark:bg-slate-900 rounded-xl shadow-md overflow-hidden my-5"><!--max-w-md md:max-w-2xl--> | ||
{{ range .Pages.ByDate.Reverse }} | ||
{{ $resource := partial "functions/get_featured_image.html" . }} | ||
{{ $anchor := .Params.image.focal_point | default "Center" }} | ||
|
||
<a href="{{ .RelPermalink }}"> | ||
<div class="md:flex"> | ||
<div class="md:flex-shrink-0"> | ||
{{ with $resource }} | ||
{{ $image := .Fill (printf "655x655 %s" $anchor) }} | ||
{{ if ne $image.MediaType.SubType "gif" }}{{ $image = $image.Process "webp" }}{{ end }} | ||
<img class="h-48 w-full object-cover md:w-48" loading="lazy" src="{{ $image.RelPermalink }}" height="{{ $image.Height }}" width="{{ $image.Width }}" alt="{{ .Title | plainify }}"> | ||
{{end}} | ||
</div> | ||
<div class="p-8"> | ||
<div class="uppercase tracking-wide text-md text-indigo-700 dark:text-indigo-200 font-semibold">{{ .Title }}</div> | ||
<p class="block mt-1 text-sm leading-tight font-medium text-black dark:text-white"> | ||
{{ (.Params.summary | default .Summary) | plainify | htmlUnescape | chomp -}} | ||
</p> | ||
<p class="mt-2 text-gray-500 dark:text-gray-400"> | ||
{{- .Date | time.Format (site.Params.locale.date_format | default ":date_long") -}} | ||
</p> | ||
</div> | ||
</div> | ||
</a> | ||
{{ end }} | ||
{{ $view := .Params.view | default "card" }} | ||
{{ $block := . }} | ||
|
||
<div class="flex justify-center"> | ||
|
||
{{ partial "functions/render_view" (dict "fragment" "start" "page" $block "item" . "view" $view) }} | ||
|
||
{{ range $index, $item := .Pages.ByDate.Reverse }} | ||
{{ partial "functions/render_view" (dict "page" . "item" . "view" $view "index" $index) }} | ||
{{end}} | ||
|
||
{{ partial "functions/render_view" (dict "fragment" "end" "page" $block "item" . "view" $view) }} | ||
|
||
</div> | ||
|
||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<div class="container max-w-[65ch] mx-auto bg-white dark:bg-slate-900 rounded-xl shadow-md overflow-hidden my-5"><!--max-w-md md:max-w-2xl--> |
2 changes: 2 additions & 0 deletions
2
modules/blox-tailwind/layouts/partials/views/date-title-summary.end.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
</div> | ||
</div> |
30 changes: 30 additions & 0 deletions
30
modules/blox-tailwind/layouts/partials/views/date-title-summary.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{{ $item := .item }} | ||
{{ $page := .page }} | ||
{{ $summary := $item.Params.summary | default $item.Params.description | default $item.Summary }} | ||
{{ $summary = $summary | page.RenderString }} | ||
<article class="md:grid md:grid-cols-4 md:items-baseline"> | ||
<div class="md:col-span-3 group relative flex flex-col items-start"> | ||
<h2 class="text-base font-semibold tracking-tight text-zinc-800 dark:text-zinc-100"> | ||
<div | ||
class="absolute -inset-x-4 -inset-y-6 z-0 scale-95 bg-zinc-50 opacity-0 transition group-hover:scale-100 group-hover:opacity-100 dark:bg-zinc-800/50 sm:-inset-x-6 sm:rounded-2xl"></div> | ||
<a href="{{$item.RelPermalink}}"><span | ||
class="absolute -inset-x-4 -inset-y-6 z-20 sm:-inset-x-6 sm:rounded-2xl"></span><span class="relative z-10">{{$item.Title}}</span></a> | ||
</h2> | ||
<time | ||
class="md:hidden relative z-10 order-first mb-3 flex items-center text-sm text-zinc-400 dark:text-zinc-500 pl-1" | ||
datetime="{{ time.Format "2006-01-02" $item.Date }}"> | ||
{{ time.Format (site.Params.locale.date_format | default ":date_long") $item.Date }} | ||
</time> | ||
<p class="relative z-10 mt-2 text-sm text-zinc-600 dark:text-zinc-400">{{$summary}}</p> | ||
<div aria-hidden="true" class="relative z-10 mt-4 flex items-center text-sm font-medium text-primary-500"> | ||
{{ T "read_more" | default "Read more" }} | ||
<svg aria-hidden="true" class="ml-1 h-4 w-4 stroke-current" fill="none" viewBox="0 0 16 16"> | ||
<path d="M6.75 5.75 9.25 8l-2.5 2.25" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path> | ||
</svg> | ||
</div> | ||
</div> | ||
<time | ||
class="mt-1 hidden md:block relative z-10 order-first mb-3 flex items-center text-sm text-zinc-400 dark:text-zinc-500" | ||
datetime="{{ time.Format "2006-01-02" $item.Date }}">{{ time.Format (site.Params.locale.date_format | default ":date_long") $item.Date }} | ||
</time> | ||
</article> |
2 changes: 2 additions & 0 deletions
2
modules/blox-tailwind/layouts/partials/views/date-title-summary.start.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<div class="mt-16 sm:mt-20"> | ||
<div class="flex max-w-3xl flex-col space-y-16"> |