[opt] h1 & title

This commit is contained in:
xaoxuu 2024-01-04 10:16:03 +08:00
parent 5c1ecd23ab
commit 48a6da7871
3 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
<% <%
function layoutTitle() { function layoutTitle() {
const title = page.h1 || page.title; const title = page.h1 != null ? page.h1 : page.title;
if (title && title.length > 0) { if (title && title.length > 0) {
return '<h1 class="article-title"><span>' + title + '</span></h1>'; return '<h1 class="article-title"><span>' + title + '</span></h1>';
} else { } else {

View File

@ -6,7 +6,7 @@ if (page.header == undefined) {
page.header = 'auto'; page.header = 'auto';
} }
function layoutTitle() { function layoutTitle() {
const title = page.h1 || page.title; const title = page.h1 != null ? page.h1 : page.title;
if (title && title.length > 0) { if (title && title.length > 0) {
return '<h1 class="article-title"><span>' + title + '</span></h1>'; return '<h1 class="article-title"><span>' + title + '</span></h1>';
} else { } else {

View File

@ -13,7 +13,7 @@ if (page.title == undefined) {
} }
} }
function layoutTitle() { function layoutTitle() {
const title = page.h1 || page.title; const title = page.h1 != null ? page.h1 : page.title;
if (title && title.length > 0) { if (title && title.length > 0) {
return '<h1 class="article-title"><span>' + title + '</span></h1>'; return '<h1 class="article-title"><span>' + title + '</span></h1>';
} else { } else {