[opt] remove seo_title

This commit is contained in:
xaoxuu 2024-01-18 12:33:12 +08:00
parent 55afa6c16e
commit f086ee6932
10 changed files with 10 additions and 15 deletions

View File

@ -1,8 +1,5 @@
<%
function generate_title() {
if (page.seo_title) {
return page.seo_title;
}
if (page.wiki) {
let proj = theme.wiki.tree[page.wiki];
let wiki = (proj && proj.name) || page.wiki;

View File

@ -98,7 +98,7 @@ function layoutDiv() {
el += ' onclick="util.toggle(&quot;qrcode-wechat&quot)"';
} else if (item == 'weibo') {
el += ' href="https://service.weibo.com/share/share.php?url=' + page.permalink;
el += '&title=' + (page.seo_title || (page.title + ' - ' + config.title));
el += '&title=' + page.title + ' - ' + config.title;
if (page.layout == 'post' && page.cover) {
el += '&pics=' + page.cover;
} else if (page.layout == 'wiki' && page.icon) {
@ -107,7 +107,7 @@ function layoutDiv() {
el += '&summary=' + truncate(page.description || strip_html(page.excerpt || page.content), {length: 120});
el += '"';
} else if (item == 'email') {
el += ' href="mailto:?subject=' + ((page.title + ' - ' + config.title) || page.seo_title) + '&amp;'
el += ' href="mailto:?subject=' + page.title + ' - ' + config.title + '&amp;'
el += 'body=' + page.permalink + '"';
} else if (item == 'link') {
el += ' onclick="util.copy(&quot;copy-link&quot;, &quot;' + __('message.copied') + '&quot;)"';

View File

@ -40,7 +40,7 @@ function layoutDiv() {
if (prev) {
el += '<div class="note">' + title_prev + '</div>';
el += '<a href="' + url_for(prev.path) + '">';
el += prev.title || prev.seo_title || prev.wiki || date(prev.date, config.date_format);
el += prev.title || prev.wiki || date(prev.date, config.date_format);
el += '</a>';
}
el += '</div>';
@ -49,7 +49,7 @@ function layoutDiv() {
if (next) {
el += '<div class="note">' + title_next + '</div>';
el += '<a href="' + url_for(next.path) + '">';
el += next.title || next.seo_title || next.wiki || date(next.date, config.date_format);
el += next.title || next.wiki || date(next.date, config.date_format);
el += '</a>';
}
el += '</div>';

View File

@ -136,14 +136,14 @@ function layoutDiv() {
`;
}
el += '</div>';
} else if (page.title || page.seo_title) {
} else if (page.title) {
el += `
<div class="bread-nav fs12">
<div class="left">
<div id="breadcrumb">
<a class="cap breadcrumb" href="${url_for(config.root)}">${home_title}</a>
<span class="sep"></span>
<a class="cap breadcrumb" href="${url_for(page.path)}">${page.title || page.seo_title}</a>
<a class="cap breadcrumb" href="${url_for(page.path)}">${page.title}</a>
</div>
</div>
</div>

View File

@ -46,7 +46,7 @@ function div_default() {
// 标题
el += '<h2 class="post-title">';
el += (post.title || post.seo_title) ? (post.title || post.seo_title) : date(post.date, config.date_format);
el += post.title ? post.title : date(post.date, config.date_format);
el += '</h2>';
// 摘要

View File

@ -11,7 +11,7 @@
var artalk = Artalk.init({
el: '#artalk_container',
pageKey: path,
pageTitle: '<%= page.title || page.seo_title %>',
pageTitle: '<%= page.title %>',
server: '<%= theme.comments.artalk.server %>',
placeholder: '<%= theme.comments.artalk.placeholder %>',
site: '<%= config.title %>',

View File

@ -39,7 +39,7 @@ function layoutDiv() {
el += '<strong>' + name + '</strong>' + '<span class="dot"></span>';
}
}
el += (post.title || post.seo_title || post.wiki) + '</span>';
el += (post.title || post.wiki) + '</span>';
if (isActive) {
el += `<svg t="1705415018387" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="14793" width="200" height="200"><path d="M256 896a42.666667 42.666667 0 0 1-20.906667-5.546667A42.666667 42.666667 0 0 1 213.333333 853.333333V227.413333A97.28 97.28 0 0 1 307.2 128h409.6A97.28 97.28 0 0 1 810.666667 227.413333V853.333333a42.666667 42.666667 0 0 1-21.333334 36.693334 42.666667 42.666667 0 0 1-42.666666 0l-241.92-136.96-227.413334 136.533333A42.666667 42.666667 0 0 1 256 896z" p-id="14794"></path></svg>`
}

View File

@ -9,7 +9,6 @@ class WikiPage {
this.id = page._id
this.wiki = page.wiki
this.title = page.title
this.seo_title = page.seo_title
this.path = page.path
this.path_key = page.path.replace('.html', '')
this.layout = page.layout

View File

@ -11,7 +11,6 @@ class RelatedPage {
this.wiki = page.wiki
this.topic = page.topic
this.title = page.title
this.seo_title = page.seo_title
this.path = page.path
this.path_key = page.path.replace('.html', '')
this.layout = page.layout

View File

@ -14,7 +14,7 @@ function layoutDocTree(ctx, pages) {
pages.forEach((p, i) => {
el += '<li>'
el += '<a class="list-link" href="' + url_for(p.path) + '">'
el += '<span>' + (p.title || p.seo_title) + '</span>'
el += '<span>' + p.title + '</span>'
el += '</a>'
el += '</li>'
})