From 48a6da787193361e3ac5b2e4eb2b9d662c1e04fe Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Thu, 4 Jan 2024 10:16:03 +0800 Subject: [PATCH] [opt] h1 & title --- layout/page.ejs | 2 +- layout/post.ejs | 2 +- layout/wiki.ejs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/layout/page.ejs b/layout/page.ejs index 80fdaa5..d837d1d 100755 --- a/layout/page.ejs +++ b/layout/page.ejs @@ -1,6 +1,6 @@ <% function layoutTitle() { - const title = page.h1 || page.title; + const title = page.h1 != null ? page.h1 : page.title; if (title && title.length > 0) { return '

' + title + '

'; } else { diff --git a/layout/post.ejs b/layout/post.ejs index 375280b..12d4af4 100755 --- a/layout/post.ejs +++ b/layout/post.ejs @@ -6,7 +6,7 @@ if (page.header == undefined) { page.header = 'auto'; } function layoutTitle() { - const title = page.h1 || page.title; + const title = page.h1 != null ? page.h1 : page.title; if (title && title.length > 0) { return '

' + title + '

'; } else { diff --git a/layout/wiki.ejs b/layout/wiki.ejs index 2c2f279..cf6a623 100755 --- a/layout/wiki.ejs +++ b/layout/wiki.ejs @@ -13,7 +13,7 @@ if (page.title == undefined) { } } function layoutTitle() { - const title = page.h1 || page.title; + const title = page.h1 != null ? page.h1 : page.title; if (title && title.length > 0) { return '

' + title + '

'; } else {