This commit is contained in:
xaoxuu 2021-02-21 13:44:11 +08:00
parent b0f60fb917
commit 5caa8aa484
8 changed files with 25 additions and 12 deletions

View File

@ -3,6 +3,7 @@ page.menu_id = '404';
page.layout = '404';
page.comment_title = '';
page.header = false;
page.robots = 'none';
%>
<article class='md error-page'>
<h1><img id='error' src="https://7.dusays.com/2021/02/20/1c830bfcd517d.svg" alt=""></h1>

View File

@ -17,11 +17,6 @@ function generate_robots() {
}
if (page.robots) {
return '<meta name="robots" content="' + page.robots + '">';
} else {
// default rule
if (['post', 'wiki', 'index'].includes(page.layout) == false) {
return '<meta name="robots" content="noindex,nofollow">';
}
}
}
function og_args() {

View File

@ -1,3 +1,14 @@
<%
if (page.utterances == undefined) {
page.utterances = theme.comments.utterances;
} else {
for (let key of Object.keys(theme.comments.utterances)) {
if (page.utterances[key] == undefined) {
page.utterances[key] = theme.comments.utterances[key];
}
}
}
%>
<script>
function pjax_utterances(){
if(!document.getElementById("utterances"))return;
@ -11,16 +22,16 @@
} catch (error) {}
var script = document.createElement('script');
script.setAttribute('src','https://utteranc.es/client.js');
script.setAttribute('repo','<%- theme.comments.utterances.repo %>');
let issuenumber = '<%- theme.comments.utterances['issue-number'] || page.comment_id %>';
script.setAttribute('repo','<%- page.utterances.repo %>');
let issuenumber = '<%- page.utterances['issue-number'] || page.comment_id %>';
if (issuenumber) {
script.setAttribute('issue-term', issuenumber);
} else {
script.setAttribute('issue-term', '<%- theme.comments.utterances['issue-term'] %>');
script.setAttribute('issue-term', '<%- page.utterances['issue-term'] %>');
}
script.setAttribute('theme', '<%- page.dark ? theme.comments.utterances.theme.dark : theme.comments.utterances.theme.light %>' );
script.setAttribute('label','<%- theme.comments.utterances.label %>');
script.setAttribute('crossorigin','<%- theme.comments.utterances.crossorigin %>');
script.setAttribute('theme', '<%- page.dark ? page.utterances.theme.dark : page.utterances.theme.light %>' );
script.setAttribute('label','<%- page.utterances.label %>');
script.setAttribute('crossorigin','<%- page.utterances.crossorigin %>');
HEAD.appendChild(script);
}, 200)
});

View File

@ -1,4 +1,5 @@
<%
page.robots = 'noindex,follow';
if (page.menu_id == undefined) {
page.menu_id = 'post';
}

View File

@ -1,4 +1,5 @@
<%
page.robots = 'noindex,follow';
if (page.menu_id == undefined) {
page.menu_id = 'post';
}

View File

@ -6,6 +6,9 @@ if (page.menu_id == undefined) {
page.menu_id = 'post';
}
}
if (page.title && page.wiki) {
page.robots = 'noindex,follow';
}
%>
<% if (page.menu_id == 'post') { %>
<%- partial('_partial/main/navbar/list_post') %>

View File

@ -1,4 +1,5 @@
<%
page.robots = 'noindex,follow';
if (page.menu_id == undefined) {
page.menu_id = 'post';
}

View File

@ -10,7 +10,7 @@
justify-content: space-between
align-items: center
cursor: pointer
min-width 250px
min-width 280px
max-width: 100%
box-shadow: $boxshadow-card
transition: box-shadow