Skip to content

Commit

Permalink
minor refactoring for the blog posts list
Browse files Browse the repository at this point in the history
  • Loading branch information
stebunovd committed Jan 1, 2025
1 parent 288177d commit 4d60ddf
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions layouts/blog/blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@
{{ end }}

{{- define "main" }}
{{- $logs := slice }}
{{- if hugo.IsDevelopment }}
{{- $logs = .Pages.ByDate.Reverse }}
{{- else }}
{{- $logs = where .Pages.ByDate.Reverse "Params.sitemap.disable" "ne" true }}
{{- $posts := .Pages.ByDate.Reverse }}
{{- if not hugo.IsDevelopment }}
{{- $posts = where $posts "Params.sitemap.disable" "ne" true }}
{{- end }}
<div class="page blog">
<div class="container">
<h1>Blog</h1>

<div class="blog--list">

{{- range $logs }}
{{- range $posts }}
<div class="blog--item">
{{- $thumbnail := .Resources.GetMatch "thumbnail.png" }}
{{- $thumbnail2x := $.Resources.GetMatch "[email protected]" }}
Expand Down

0 comments on commit 4d60ddf

Please sign in to comment.