69 lines
2.2 KiB
Plaintext
Executable File
69 lines
2.2 KiB
Plaintext
Executable File
<%
|
|
function getTitle() {
|
|
if (page.seo_title || page.title || page.wiki || page.layout) {
|
|
return (page.seo_title || page.title || page.wiki || page.layout) + ' - ' + config.title;
|
|
} else if (page.category) {
|
|
return __('btn.category') + __('symbol.colon') + page.category + ' - ' + config.title;
|
|
} else if (page.tag) {
|
|
return __('btn.tag') + __('symbol.colon') + page.tag + ' - ' + config.title;
|
|
} else {
|
|
return config.title;
|
|
}
|
|
return '';
|
|
}
|
|
if (page.description == undefined) {
|
|
page.description = stellar_meta('description', page);
|
|
}
|
|
function og_args() {
|
|
var args = {};
|
|
if (theme.open_graph.twitter_id) {
|
|
args.twitter_id = theme.open_graph.twitter_id;
|
|
}
|
|
if (page.layout == 'post' && page.cover) {
|
|
args.twitter_card = 'summary_large_image';
|
|
}
|
|
return args;
|
|
}
|
|
%>
|
|
<head hexo-theme='<%- stellar_info("tree") %>'>
|
|
<%- meta_generator() %>
|
|
<meta charset="utf-8">
|
|
<meta name='robots' content='<%- stellar_meta("robots", page) %>'>
|
|
|
|
<meta http-equiv='x-dns-prefetch-control' content='on' />
|
|
<link rel='dns-prefetch' href='https://cdn.jsdelivr.net'>
|
|
<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin>
|
|
|
|
<meta name="renderer" content="webkit">
|
|
<meta name="force-rendering" content="webkit">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
|
|
<meta name="HandheldFriendly" content="True" >
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
|
|
|
<title><%- getTitle() %></title>
|
|
|
|
<% if (theme.open_graph && theme.open_graph.enable) { %>
|
|
<%- open_graph(og_args()) %>
|
|
<% } %>
|
|
|
|
<!-- feed -->
|
|
<% if (config.feed && config.feed.path) { %>
|
|
<%- feed_tag(config.feed.path, {title: config.title}) %>
|
|
<% } %>
|
|
|
|
<% if (theme.stellar.cdn_css) { %>
|
|
<%- css(theme.stellar.cdn_css) %>
|
|
<% } else { %>
|
|
<%- css('/css/main.css') %>
|
|
<% } %>
|
|
|
|
<% if (config.inject && config.inject.head){ %>
|
|
<% (config.inject.head||[]).forEach(function(item){ %>
|
|
<%- item %>
|
|
<% }) %>
|
|
<% } else if (config.favicon) { %>
|
|
<link rel="shortcut icon" type='image/x-icon' href="<%- url_for(config.favicon) %>">
|
|
<% } %>
|
|
</head>
|