Skip to content

Commit

Permalink
fix: display description when exists
Browse files Browse the repository at this point in the history
Closes #136
  • Loading branch information
wangchucheng committed Oct 4, 2021
1 parent 82a2d12 commit 920c3cc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion layouts/partials/components/summary-masonry.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
<a href="{{ .Permalink }}" class="hover:text-eureka">{{ .LinkTitle }}</a>
</div>
<div class="">
{{- .Summary | plainify -}}
{{ if .Description }}
{{ .Description | plainify | htmlUnescape }}
{{ else if .Summary }}
{{ .Summary | plainify | htmlUnescape }}
{{ end }}
</div>
</div>
<div class="px-6 pb-2">
Expand Down
12 changes: 10 additions & 2 deletions layouts/partials/utils/get-summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
<a href="{{ .Permalink }}" class="font-bold text-xl hover:text-eureka">{{ .LinkTitle }}</a>
</div>
<div class="content">
{{ .Summary | plainify | htmlUnescape }}
{{ if .Description }}
{{ .Description | plainify | htmlUnescape }}
{{ else if .Summary }}
{{ .Summary | plainify | htmlUnescape }}
{{ end }}
</div>
{{ if eq .Type "docs" }}
<div class="px-6 pt-4">
Expand All @@ -15,7 +19,11 @@
<a href="{{ .Permalink }}" class="font-semibold hover:text-eureka">{{ .LinkTitle }}</a>
</div>
<div class="">
{{- .Summary | plainify | htmlUnescape -}}
{{ if .Description }}
{{ .Description | plainify | htmlUnescape }}
{{ else if .Summary }}
{{ .Summary | plainify | htmlUnescape }}
{{ end }}
</div>
</div>
{{ end }}
Expand Down

1 comment on commit 920c3cc

@KermanX
Copy link

@KermanX KermanX commented on 920c3cc Nov 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Please sign in to comment.