Skip to content

Commit 38bfc20

Browse files
saberhqclaude
andcommitted
Fix blogcards shortcode to properly find blog posts
Use .Site.GetPage to get the blog section directly instead of filtering by Section name, which only returns top-level sections. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent cae3535 commit 38bfc20

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

layouts/shortcodes/blogcards.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{{- $limit := .Get "limit" | default 100 -}}
22
{{- $section := .Get "section" | default "docs/blog" -}}
3-
{{- $posts := where (where .Site.RegularPages "Section" $section) ".Params.image" "!=" nil -}}
3+
{{- $blogSection := .Site.GetPage $section -}}
4+
{{- $posts := where $blogSection.RegularPages ".Params.image" "!=" nil -}}
45
{{- $posts = $posts | first (int $limit) -}}
56

67
<div class="card-grid">

0 commit comments

Comments
 (0)