Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wangchucheng/hugo-eureka.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWang Chucheng <me@wangchucheng.com>2021-10-04 05:58:19 +0300
committerWang Chucheng <me@wangchucheng.com>2021-10-04 05:58:19 +0300
commit920c3cce3e7004718c997045c05501a00195f056 (patch)
tree73fffd49053e895ed73e96b4965b598c0a3c73f7
parent82a2d12ff8b42572b4278b597b92ed230b82acd6 (diff)
fix: display description when exists
Closes #136
-rw-r--r--layouts/partials/components/summary-masonry.html6
-rw-r--r--layouts/partials/utils/get-summary.html12
2 files changed, 15 insertions, 3 deletions
diff --git a/layouts/partials/components/summary-masonry.html b/layouts/partials/components/summary-masonry.html
index 2e25854..4027f7a 100644
--- a/layouts/partials/components/summary-masonry.html
+++ b/layouts/partials/components/summary-masonry.html
@@ -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">
diff --git a/layouts/partials/utils/get-summary.html b/layouts/partials/utils/get-summary.html
index 82a43ed..55eb35c 100644
--- a/layouts/partials/utils/get-summary.html
+++ b/layouts/partials/utils/get-summary.html
@@ -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">
@@ -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 }}