From d29ccf778c5b054f7855cc970fd2fe32a2985391 Mon Sep 17 00:00:00 2001 From: Nick Kocharhook Date: Tue, 11 Jan 2022 23:06:38 +0000 Subject: [PATCH] Support Markdown in post titles. --- .gitignore | 2 +- assets/ts/search.tsx | 6 +++++- layouts/_default/list.html | 2 +- layouts/partials/article-list/compact.html | 2 +- layouts/partials/article-list/tile.html | 2 +- layouts/partials/article/components/details.html | 2 +- layouts/partials/head/head.html | 2 +- 7 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 9ebefdf..871ca25 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ public resources -assets/jsconfig.json \ No newline at end of file +assets/jsconfig.json diff --git a/assets/ts/search.tsx b/assets/ts/search.tsx index 8e4eb6f..8d84ce7 100644 --- a/assets/ts/search.tsx +++ b/assets/ts/search.tsx @@ -224,7 +224,7 @@ class Search { return
-

+

{item.image && @@ -235,6 +235,10 @@ class Search {
; } + + private static displayTitle(item) { + return item.title.replace(/_/g, ''); + } } declare global { diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 90e5b66..a979d27 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -10,7 +10,7 @@

{{ T "list.page" (len .Pages) }}

-

{{ .Title }}

+

{{ .Title | markdownify }}

{{ with .Params.description }}

{{ . }}

{{ end }} diff --git a/layouts/partials/article-list/compact.html b/layouts/partials/article-list/compact.html index 376512a..024678b 100644 --- a/layouts/partials/article-list/compact.html +++ b/layouts/partials/article-list/compact.html @@ -2,7 +2,7 @@

- {{- .Title -}} + {{- .Title | markdownify -}}