Skip to content

Commit

Permalink
style: hide the read more button from pinned posts on homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Oct 14, 2023
1 parent da4889d commit 56c5945
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion layouts/partials/hb/modules/blog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</div>
{{- with $pinnedPages }}
<div class="col-12 col-lg-6">
{{ partial "hb/modules/blog/posts" (dict "Pages" . "Cols" "row-cols-1") }}
{{ partial "hb/modules/blog/posts" (dict "Pages" . "Cols" "row-cols-1" "ReadMore" false) }}
</div>
{{- end }}
</div>
Expand Down
3 changes: 2 additions & 1 deletion layouts/partials/hb/modules/blog/post/card.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{- $page := .Page }}
{{- $showSummary := default true .Summary }}
{{- $readMore := default true .ReadMore }}
{{- $readingTime := default true .ReadingTime }}
{{- $meta := default true .Meta }}
<div class="hb-blog-post-card hb-module card border-0 overflow-hidden h-100 mb-0">
Expand Down Expand Up @@ -40,7 +41,7 @@
<div class="hb-blog-post-summary card-text text-secondary mb-auto">
{{- $summary -}}
</div>
{{- if $truncated }}
{{- if and $readMore $truncated }}
<div class="mt-2">
<a
class="btn btn-sm btn-outline-secondary" href="{{ .RelPermalink }}">
Expand Down
3 changes: 2 additions & 1 deletion layouts/partials/hb/modules/blog/posts.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{{- $cols := default "row-cols-1 row-cols-lg-2 row-cols-xl-3" .Cols }}
{{- $readMore := default true .ReadMore }}
<div class="hb-blog-posts row {{ $cols }} g-3 mb-3">
{{ range .Pages }}
<div class="col">
{{- $ctx := dict "Page" . }}
{{- $ctx := dict "Page" . "ReadMore" $readMore }}
{{ partial "hb/modules/blog/post/card" $ctx }}
</div>
{{ end }}
Expand Down

0 comments on commit 56c5945

Please sign in to comment.