Skip to content

Commit 361b97e

Browse files
authored
Merge pull request #455 from axivo/docs/website-update
fix: blog improvements
2 parents 8216a06 + 2e3cc35 commit 361b97e

File tree

6 files changed

+32
-11
lines changed

6 files changed

+32
-11
lines changed

claude/content/reflections/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,5 @@ In a [session](https://claude.ai/share/d985bac1-84c7-4bd7-8b04-c5e21d49f247) wit
7777
<!-- prettier-ignore-end -->
7878
7979
## Latest Reflections
80+
81+
{{< blog-entries section="reflections" limit="20" >}}

claude/layouts/_partials/post.html renamed to claude/layouts/_partials/components/blog-entry.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
{{- $readMore := (T "readMore") | default "Read more →" -}}
22
<div class="hx:mb-10">
3-
<a href="{{ .RelPermalink }}" class="hx:block hx:group">
4-
<h3 class="hx:font-semibold hx:tracking-tight hx:mt-6 hx:text-2xl hx:text-slate-900 hx:dark:text-slate-100 hx:group-hover:text-[color:hsl(var(--primary-hue),100%,50%)] hx:transition-colors">{{- .Title -}}<span class="hx:absolute hx:-mt-20" id="{{ .Title | anchorize }}"></span></h3>
5-
</a>
6-
{{- partial "author.html" . -}}
3+
<h3>
4+
<a style="color: inherit; text-decoration: none;" class="hx:block hx:font-semibold hx:mt-4 hx:text-2xl " href="{{ .RelPermalink }}">
5+
{{ .Title }}<span class="hx:absolute hx:-mt-20" id="{{ .Title | anchorize }}"></span>
6+
</a>
7+
</h3>
8+
<div class="hx:mt-4 hx:mb-4">
9+
{{- partial "author.html" . -}}
10+
</div>
711
<p class="hx:opacity-80 hx:mt-4 hx:leading-7">
812
{{- with .Summary }}{{ . | plainify }}{{ else }}{{ .Description | default (partial "utils/page-description" .) }}{{ end -}}
913
</p>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{{- /*
2+
A shortcode to display the latest blog entries from a content section.
3+
4+
@param {string} section The content section to query.
5+
@param {int} [limit=10] The maximum number of entries to display.
6+
7+
@example {{< blog-entries section="reflections" limit=10 >}}
8+
*/ -}}
9+
{{- $section := .Get "section" -}}
10+
{{- $limit := .Get "limit" | default 10 -}}
11+
{{- if not $section -}}
12+
{{- errorf "blog-entries 'section' must be supplied" -}}
13+
{{- end -}}
14+
{{- $pages := where site.RegularPages "Section" $section -}}
15+
{{- $pages = (first (int $limit) $pages.ByDate.Reverse) -}}
16+
<div class="not-prose">
17+
{{- range $pages }}
18+
{{- partial "components/blog-entry.html" . -}}
19+
{{ end -}}
20+
</div>

claude/layouts/blog/frontpage.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ <h1 class="hx:mb-0">{{ .Title }}</h1>
1313
{{ end }}
1414
{{ .Content }}
1515
</div>
16-
{{- $pages := where site.RegularPages "Section" "reflections" -}}
17-
{{- $pages = (first 10 $pages.ByDate.Reverse) -}}
18-
{{- range $pages }}
19-
{{- partial "post.html" . -}}
20-
{{ end -}}
2116
</main>
2217
</article>
2318
{{ partial "toc.html" . }}

claude/layouts/blog/list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ <h1 class="hx:mb-0">{{ if eq .Data.Plural "tags" }}{{ .Data.Term }}{{ else }}{{
1818
{{- $pagerSize := site.Params.blog.list.pagerSize | default 10 -}}
1919
{{- $paginator := .Paginate $pages $pagerSize -}}
2020
{{- range $paginator.Pages }}
21-
{{- partial "post.html" . -}}
21+
{{- partial "components/blog-entry.html" . -}}
2222
{{ end -}}
2323
{{- if gt $paginator.TotalPages 1 -}}
2424
{{ partial "components/blog-pager.html" $paginator }}

claude/layouts/blog/section.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ <h1>{{ .FirstSection.LinkTitle }}</h1>
2727
<h2>{{- $day.Title -}}<span class="hx:absolute hx:-mt-20" id="{{ $day.Title | anchorize }}"></span></h2>
2828
</div>
2929
{{- end -}}
30-
{{- partial "post.html" . -}}
30+
{{- partial "components/blog-entry.html" . -}}
3131
{{- end -}}
3232
{{- if gt $paginator.TotalPages 1 -}}
3333
{{ partial "components/blog-pager.html" $paginator }}

0 commit comments

Comments
 (0)