Skip to content

Commit

Permalink
优化,最终版
Browse files Browse the repository at this point in the history
百度统计、
  • Loading branch information
can-dy-jack committed Feb 25, 2022
1 parent 761cbb2 commit fc03178
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 26 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ More details Read:[kartjim.cn/delicate](https://kartjim.cn/delicate/2021/11/12

## 开发计划

- [ ] npm
- [ ] 添加404页面
- [ ] 文章分享功能
- [ ] 永久链接问题
Expand Down
18 changes: 14 additions & 4 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# header
title: delicate
titleLogo: '/favicon/logo2.ico'
title: delicate主题
# 友链,`divider: true`是分隔符
friend:
enable: true
Expand Down Expand Up @@ -228,9 +229,18 @@ fancybox:
## 评论系统 ##
# --------------------------- #
valine:
enable: true
id: 'hdaW9uaYaxJSxUV25qnTklcl-gzGzoHsz'
key: 'LNVM14E2XykcTyqqYyxbIswp'
enable: false
id: ''
key: ''
# textarea's placeholder
placeholder: "请发表您的意见和建议(支持 markdown 语法)"
lang: 'zh-CN'


# --------------------------- #
## analytic ##
# --------------------------- #
baidu_analytic:
enable: false
key: ''

9 changes: 9 additions & 0 deletions layout/_partial/baidu-analytics.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?<%- theme.baidu_analytic.key %>";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
25 changes: 8 additions & 17 deletions layout/_partial/head.ejs
Original file line number Diff line number Diff line change
@@ -1,31 +1,18 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<meta name="description" content="">
<meta name="author" content="">

<link rel="icon" href="<%- config.root %>/favicon/logo2.ico">

<title>delicate</title>
<meta name="description" content="<%- config.description %>">
<meta name="author" content="<%- config.author %>">
<link rel="icon" href="<%- config.root %><%- theme.titleLogo %>">
<title><%- config.title %> <%- page.title %></title>
<%- css('css/blog.css') %>
<!-- Bootstrap core CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css" rel="stylesheet">

<!-- Bootstrap 图标 -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css">

<!-- fancybox -->
<% if(theme.fancybox.enable){ %>
<link href="https://cdn.bootcdn.net/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.css" rel="stylesheet">
<% } %>

<!-- Custom styles for this template -->
<%- css('css/archive.css') %>
<%- css('css/markdown.css') %>
<%- css('css/plugins.css') %>

<!-- 默认背景 -->
<%
var headerColor = theme.style.color.header || '#fff',
Expand Down Expand Up @@ -113,4 +100,8 @@
<script src="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js"></script>
<% } %>

<% if (theme.baidu_analytic.enable){ %>
<%- partial('baidu-analytics') %>
<% } %>

</head>
4 changes: 3 additions & 1 deletion layout/_partial/header.ejs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<div class="blog-header">
<h1 class="blog-title"><%= config.title %></h1>
<p class="lead blog-description">
<% if (config.subtitle){ %><%= config.subtitle %><% } %>
<% if (config.subtitle){ %>
<%- config.subtitle %>
<% } %>
</p>
</div>
Empty file removed layout/categories.ejs
Empty file.
1 change: 0 additions & 1 deletion layout/layout.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@
<%- partial('_partial/footer') %>
<canvas class="fireworks" style="position: fixed;left: 0;top: 0;z-index: 1; pointer-events: none;" ></canvas>
<%- partial('_partial/after-footer') %>

</body>
</html>
4 changes: 1 addition & 3 deletions layout/post.ejs
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@

<%- partial('_partial/article-full', {item: page}) %>

<%- partial('_partial/article-full', {item: page}) %>

0 comments on commit fc03178

Please sign in to comment.