Don't include drafts on the home page

This commit is contained in:
Michael Zhang 2022-02-02 03:19:09 -06:00 committed by Michael Zhang
parent 56bbbc5dee
commit 34ea75029b
2 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@ sources:
tasks:
- build: |
cd blog
hugo --minify --baseURL https://mzhang.io
hugo --buildDrafts --minify --baseURL https://mzhang.io
- upload: |
cd blog
echo "mzhang.io ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBzBZ+QmM4EO3Fwc1ZcvWV2IY9VF04T0H9brorGj9Udp" >> ~/.ssh/known_hosts

View File

@ -8,8 +8,8 @@
<h2 id="blog-posts-title"><a href="/posts">recent blog posts &raquo;</a></h2>
<ul id="blog-posts">
{{ $posts := .GetPage "/posts" }}
{{- range first 3 $posts.Pages -}}
{{ $posts := where (.GetPage "/posts").Pages "Draft" false }}
{{- range first 3 $posts -}}
<li><a href="{{ .RelPermalink }}" class="blog-post-link">
<span class="blog-post">
<span class="title">{{ .Title }}</span>