소스 검색

Set homepage to only show true blog posts

The "Recent Blog Posts" section was showing blog posts even if they were
in subsections of blog posts. This was undesirable behavior. Updated to
only show posts that are direct children of the Blog section.
Bee Hudson 1 년 전
부모
커밋
bb9c1196a3
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      layouts/index.html

+ 2 - 2
layouts/index.html

@@ -4,8 +4,8 @@
 	<section class="grid grid-cols-1 lg:grid-cols-2 gap-4">
 		<section id="blog-posts" class="panel h-feed">
 			<h1 class="mb-4"><a href="/blog/" class="p-name">Recent Blog Posts</a></h1>
-			{{ range first 3 (where .Site.RegularPages "Section" "blog") }}
-			{{ partial "entrypanel.html" . }}
+			{{ range first 3 (where .Site.RegularPages "CurrentSection.Title" (.Site.GetPage "/blog").Title) }}
+					{{ partial "entrypanel.html" . }}
 			{{ end }}
 		</section>
 		<section id="project-posts" class="panel h-feed">