主题页面精简
This commit is contained in:
@@ -7,25 +7,9 @@ window.themeConfig = {
|
||||
isCategory: <%=is_category()%>, // 是否为分类页面
|
||||
pageid: <%-page.pageid ? `"${page.pageid}"` : 'undefined'%>, // 页面标识, 用于个性化页面开发
|
||||
toc_hide_index: <%=theme.toc_hide_index%>, // 目录序号
|
||||
root: "<%=config.root%>", // 资源根路径
|
||||
pictureCdn: "<%=config.picture_cdn%>" // 图片存储仓库地址
|
||||
root: '<%=config.root%>', // 资源根路径
|
||||
baseUrl: '<%=config.url%>',
|
||||
pictureCdn: '<%=config.picture_cdn%>' // 图片存储仓库地址
|
||||
}
|
||||
</script>
|
||||
<%- partial('script') %>
|
||||
<% if(theme.gitalk.enable && is_post()) { %>
|
||||
<link rel="stylesheet" type="text/css" href="https://unpkg.com/gitalk/dist/gitalk.css">
|
||||
<script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>
|
||||
<script>
|
||||
(function(Gitalk){
|
||||
new Gitalk({
|
||||
clientID: '<%=theme.gitalk.ClientID%>',
|
||||
clientSecret: '<%=theme.gitalk.ClientSecret%>',
|
||||
repo: '<%=theme.gitalk.repo%>',
|
||||
owner: '<%=theme.gitalk.githubID%>',
|
||||
admin: ['<%=theme.gitalk.adminUser%>'],
|
||||
id: decodeURI(location.pathname),
|
||||
distractionFreeMode: <%=theme.gitalk.distractionFreeMode%>
|
||||
}).render('comments')
|
||||
})(Gitalk)
|
||||
</script>
|
||||
<% } %>
|
||||
<%- partial('script') %>
|
||||
@@ -79,7 +79,7 @@
|
||||
<a class="article-more-a" href="<%- url_for(post.path) %>"><%= __('show_full_text') %> >></a>
|
||||
</p>
|
||||
<% } %>
|
||||
<% if (!param.index && theme.share_jia){ %>
|
||||
<% if (!param.index && theme.share_enable){ %>
|
||||
<%- partial('post/share') %>
|
||||
<% } %>
|
||||
<div class="clearfix"></div>
|
||||
@@ -90,33 +90,6 @@
|
||||
<%- partial('post/nav') %>
|
||||
<% } %>
|
||||
|
||||
<% if (!param.index && post.comments){ %>
|
||||
<% if (theme.changyan_appid && theme.changyan_conf){ %>
|
||||
<%- partial('post/changyan', {
|
||||
key: post.slug,
|
||||
title: post.title,
|
||||
url: config.url+url_for(post.path)
|
||||
}) %>
|
||||
<% } %>
|
||||
|
||||
<% if (theme.disqus || config.disqus_shortname){ %>
|
||||
<section id="comments">
|
||||
<div id="disqus_thread"></div>
|
||||
<script type="text/javascript">
|
||||
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
|
||||
var disqus_shortname = '<%= theme.disqus || config.disqus_shortname %>'; // required: replace example with your forum shortname
|
||||
|
||||
/* * * DON'T EDIT BELOW THIS LINE * * */
|
||||
(function() {
|
||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||||
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
})();
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
||||
</section>
|
||||
<% }
|
||||
if(theme.gitalk.enable || theme.valine.enable){ %>
|
||||
<% if (!param.index && post.comments && theme.valine.enable){ %>
|
||||
<div id="comments"></div>
|
||||
<% } %>
|
||||
<% } %>
|
||||
@@ -1,11 +0,0 @@
|
||||
<% if (theme.baidu_analytics){ %>
|
||||
<script>
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?<%= theme.baidu_analytics %>";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>
|
||||
<% } %>
|
||||
@@ -1,14 +0,0 @@
|
||||
<% if (theme.google_analytics){ %>
|
||||
<!-- Google Analytics -->
|
||||
<script type="text/javascript">
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', '<%= theme.google_analytics %>', 'auto');
|
||||
ga('send', 'pageview');
|
||||
|
||||
</script>
|
||||
<!-- End Google Analytics -->
|
||||
<% } %>
|
||||
@@ -22,12 +22,10 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<%- open_graph({twitter_id: theme.twitter, google_plus: theme.google_plus, fb_admins: theme.fb_admins, fb_app_id: theme.fb_app_id}) %>
|
||||
<% if (theme.rss){ %>
|
||||
<link rel="alternative" href="<%- theme.rss %>" title="<%= config.title %>" type="application/atom+xml">
|
||||
<link rel="alternative" href="<%- url_for(theme.rss) %>" title="<%= config.title %>" type="application/atom+xml">
|
||||
<% } %>
|
||||
<% if (theme.favicon){ %>
|
||||
<link rel="icon" href="<%- theme.favicon %>">
|
||||
<link rel="icon" href="<%- url_for(theme.favicon) %>">
|
||||
<% } %>
|
||||
<%- partial('css') %>
|
||||
<%- partial('google-analytics') %>
|
||||
<%- partial('baidu-analytics') %>
|
||||
</head>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</nav>
|
||||
<nav id="sub-nav">
|
||||
<% if (theme.rss){ %>
|
||||
<a id="nav-rss-link" class="nav-icon" href="<%- theme.rss %>" title="RSS Feed"></a>
|
||||
<a id="nav-rss-link" class="nav-icon" href="<%- url_for(theme.rss) %>" title="RSS Feed"></a>
|
||||
<% } %>
|
||||
<a id="nav-search-btn" class="nav-icon" title="Search"></a>
|
||||
</nav>
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
<div id="SOHUCS" sid="<%=key%>" ></div>
|
||||
<script charset="utf-8" type="text/javascript" src="//changyan.sohu.com/upload/changyan.js" ></script>
|
||||
<script type="text/javascript">
|
||||
window.changyan.api.config({
|
||||
appid: "<%=theme.changyan_appid%>",
|
||||
conf: "<%=theme.changyan_conf%>"
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
@@ -1,18 +0,0 @@
|
||||
<div class="duoshuo">
|
||||
<!-- 多说评论框 start -->
|
||||
<div class="ds-thread" data-thread-key="<%=key%>" data-title="<%=title%>" data-url="<%=url%>"></div>
|
||||
<!-- 多说评论框 end -->
|
||||
<!-- 多说公共JS代码 start (一个网页只需插入一次) -->
|
||||
<script type="text/javascript">
|
||||
var duoshuoQuery = {short_name:"<%=theme.duoshuo%>"};
|
||||
(function() {
|
||||
var ds = document.createElement('script');
|
||||
ds.type = 'text/javascript';ds.async = true;
|
||||
ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
|
||||
ds.charset = 'UTF-8';
|
||||
(document.getElementsByTagName('head')[0]
|
||||
|| document.getElementsByTagName('body')[0]).appendChild(ds);
|
||||
})();
|
||||
</script>
|
||||
<!-- 多说公共JS代码 end -->
|
||||
</div>
|
||||
@@ -37,11 +37,11 @@
|
||||
</div>
|
||||
|
||||
<div class="page-modal wx-share js-wx-box">
|
||||
<a class="close js-modal-close" href="javascript:;"><i class="icon icon-close"></i></a>
|
||||
<p>扫一扫,分享到微信</p>
|
||||
<div class="wx-qrcode" title="微信分享二维码">
|
||||
<canvas class="qrcode-canvas" style="height:150px;width:150px;"></canvas>
|
||||
</div>
|
||||
<a class="close js-modal-close" href="javascript:;"><i class="icon icon-close"></i></a>
|
||||
<p>扫一扫,分享到微信</p>
|
||||
<div class="wx-qrcode" title="微信分享二维码">
|
||||
<canvas class="qrcode-canvas" style="height:150px;width:150px;"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mask js-mask"></div>
|
||||
Reference in New Issue
Block a user