Skip to content

Commit

Permalink
Remove post content from listing
Browse files Browse the repository at this point in the history
The way subtitles get rendered is confusing, and this approach is much
simpler than trying to tweak this. A shorter listing will likely be
better once we have multiple articles too.
  • Loading branch information
WhyNotHugo committed May 25, 2024
1 parent 656b983 commit 4a377f8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
5 changes: 5 additions & 0 deletions assets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,8 @@ article {
margin-left: 1rem;
}
}

.post-details {
color: gray;
margin-top: -1rem;
}
6 changes: 6 additions & 0 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{{ define "main" }}
<h1>{{ .Title }}</h1>
<p class="post-details">
Written by {{ .Params.Author }} on
<time datetime="{{.Date.Format "2006-01-02"}}">
{{ .Date.Format "2006-01-02" }}
</time>
</p>

<article>
{{ .Content }}
Expand Down
7 changes: 2 additions & 5 deletions layouts/blog/section.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
<section class="article-list">
{{ range (where .Site.RegularPages "Section" "blog") }}
<div class="blog-post">
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
<div>
<h1><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
<div class="post-details">
Written by {{ .Params.Author }} on
<time datetime="{{.Date.Format "2006-01-02"}}">
{{ .Date.Format "2006-01-02" }}
</time>
</div>

{{ .Content }}

</div>
{{ end }}
</section>
Expand Down

0 comments on commit 4a377f8

Please sign in to comment.