Skip to content

Commit

Permalink
Change: Condense and simplify all-posts page
Browse files Browse the repository at this point in the history
See <#130>.
  • Loading branch information
alphapapa committed Oct 10, 2023
1 parent e42f85b commit 4137186
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
10 changes: 6 additions & 4 deletions assets/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ div.MathJax_Display {
margin-bottom: 0;
}

img.post-featuredImage {
width: 15rem;
float: left;
padding-right: 1rem;
.post-featuredImage img {
/* FIXME: Use color variable. */
border: 0.15em #bbb solid;
border-radius: 25px;
max-width: 20rem;
margin: 0.5em;
}

.tag-cloud {
Expand Down
9 changes: 6 additions & 3 deletions layouts/partials/post_meta.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{{- $featuredImage := .Resources.GetMatch "featuredImage" -}}
<div class="post-meta">
{{ with $featuredImage }}
<img class="post-featuredImage" src="{{ .RelPermalink }}" {{ if .Params.description }}alt="{{ .Params.description }}"{{ end }}/>
{{ end }}
<!-- FIXME: What is this </span> closing? -->
</span>
<span class="post-authors">
{{- range .Params.author -}}
Expand All @@ -20,5 +18,10 @@
<span class="post-tag"><a href="{{ path.Join "/tags/" $tag | relURL }}">#{{ $tag }}</a></span>
{{- end -}}
</div>
<div class="post-featuredImage">
{{ with $featuredImage }}
<img src="{{ .RelPermalink }}" {{ if .Params.description }}alt="{{ .Params.description }}"{{ end }}/>
{{ end }}
</div>
{{- end -}}
</div>
7 changes: 2 additions & 5 deletions layouts/posts/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,12 @@ <h2 class="tag-cloud-title">{{ i18n "tags" }}</h2>
</div>

<div class="content-container">
{{ $paginator := .Paginate (where $.Site.RegularPages.ByPublishDate.Reverse "Section" "posts") }}
{{ $paginator := .Paginate (where $.Site.RegularPages.ByPublishDate.Reverse "Section" "posts") 50 }}
{{ range $paginator.Pages }}
<div class="post-list">
<article>
<div class="post-title"><a href="{{ .RelPermalink }}">{{ .Title }}</a></div>
{{ partial "post_meta.html" . }}
<div class="post-summary">
{{ .Summary }}
</div>
<div>{{ partial "post_meta.html" . }}</div>
</article>
</div>
{{ end }}
Expand Down

0 comments on commit 4137186

Please sign in to comment.