Skip to content

Commit b9c5a3d

Browse files
committed
chore: remove header tags in blog summary
1 parent 06a5c3a commit b9c5a3d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

themes/hugoplate/layouts/partials/components/blog-card.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ <h4 class="mb-3">
3333
</ul>
3434
{{ end }}
3535
<p class="mb-6">
36-
{{ .Summary | truncate 150 "…" }}
36+
{{ $summary := .Summary }}
37+
{{ $cleanedSummary := $summary | replaceRE "<h[1-6][^>]*>.*?</h[1-6]>" "" }}
38+
{{ $truncatedSummary := $cleanedSummary | plainify | truncate 150 }}
39+
{{ $truncatedSummary | safeHTML }}
3740
</p>
3841
<a class="btn btn-outline-primary btn-sm" href="{{ .RelPermalink }}">
3942
{{ T "read_more" }}

0 commit comments

Comments
 (0)