From de41f65d55d03a4b792975b19a3b34153ece5cfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=AE=87?= <448766534@qq.com> Date: Fri, 6 Dec 2019 11:31:19 +0800 Subject: [PATCH 1/3] fix README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b7106dd..fe2f53a 100644 --- a/README.md +++ b/README.md @@ -226,4 +226,5 @@ Use Tocbot to parse the title tags (h1~h6) in the content and insert the directo --- +Inspired by [Ocean](https://github.com/zhwangart/hexo-theme-ocean) Creative Commons License
Ayer by Eric-Shen is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. \ No newline at end of file From 08c9fb777e3cd3c1174f66c39128c22b19adb875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=AE=87?= <448766534@qq.com> Date: Fri, 6 Dec 2019 11:33:14 +0800 Subject: [PATCH 2/3] fix:README.md --- README.md | 1 + source/css/_variables.styl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fe2f53a..817eccc 100644 --- a/README.md +++ b/README.md @@ -227,4 +227,5 @@ Use Tocbot to parse the title tags (h1~h6) in the content and insert the directo --- Inspired by [Ocean](https://github.com/zhwangart/hexo-theme-ocean) + Creative Commons License
Ayer by Eric-Shen is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. \ No newline at end of file diff --git a/source/css/_variables.styl b/source/css/_variables.styl index adbc47f..3dae2ce 100644 --- a/source/css/_variables.styl +++ b/source/css/_variables.styl @@ -50,7 +50,7 @@ border-radius = 0.4rem border-width = 0.1rem border-color = froth -// Lyout +// Layout aside-width = 7rem wrap-width = 70rem years-width = 6rem From d7cf77544ca65b9243d4c3f79fdf39e0104f5eae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=AE=87?= <448766534@qq.com> Date: Fri, 6 Dec 2019 12:56:15 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20Google=20Analytics=EF=BC=8C?= =?UTF-8?q?=E7=99=BE=E5=BA=A6=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 +++ _config.yml | 5 +++ layout/_partial/baidu-analytics.ejs | 11 ++++++ layout/_partial/google-analytics.ejs | 14 ++++++++ layout/_partial/head.ejs | 53 ++++++++++++++-------------- 5 files changed, 61 insertions(+), 27 deletions(-) create mode 100644 layout/_partial/baidu-analytics.ejs create mode 100644 layout/_partial/google-analytics.ejs diff --git a/README.md b/README.md index 817eccc..5d1f197 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,11 @@ cnzz: enable: true url: # +# Google Analytics +google_analytics: '' +# 百度统计 +baidu_analytics: '' + # 数学公式 mathjax: true diff --git a/_config.yml b/_config.yml index a264009..c77e3d5 100644 --- a/_config.yml +++ b/_config.yml @@ -86,6 +86,11 @@ cnzz: enable: true url: https://s9.cnzz.com/z_stat.php?id=1278069914&web_id=1278069914 +# Google Analytics +google_analytics: '' +# 百度统计 +baidu_analytics: '' + # 数学公式 mathjax: true diff --git a/layout/_partial/baidu-analytics.ejs b/layout/_partial/baidu-analytics.ejs new file mode 100644 index 0000000..e9bd0b6 --- /dev/null +++ b/layout/_partial/baidu-analytics.ejs @@ -0,0 +1,11 @@ +<% if (theme.baidu_analytics){ %> + +<% } %> diff --git a/layout/_partial/google-analytics.ejs b/layout/_partial/google-analytics.ejs new file mode 100644 index 0000000..f3025dc --- /dev/null +++ b/layout/_partial/google-analytics.ejs @@ -0,0 +1,14 @@ +<% if (theme.google_analytics){ %> +<%# "Google Analytics" %> + +<%# "End Google Analytics" %> +<% } %> diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index 69bc754..dbe140a 100644 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -1,34 +1,33 @@ - - - <% var title = page.title; if (is_archive()) { title = __('archive_a'); if + + + + <% var title = page.title; if (is_archive()) { title = __('archive_a'); if (is_month()) { title += ': ' + page.year + '/' + page.month; } else if (is_year()) { title += ': ' + page.year; } } else if (is_category()) { title = __('categories.ejs') + ': ' + page.categories; } else if (is_tag()) { title = __('tag') + ': ' + page.tag; } %> <% if (page.keywords){ %> - - <% } else if (config.keywords){ %> - - <% } %> <% if (page.description){ %> - - <% } else if (config.description){ %> - - <% } %> - - - <% if (title){ %><%= title %> | <% } %> <%= config.title %> - - <% if (theme.favicon){ %> - - <% } %> - <%- css('css/style') %> <% if (theme.fancybox){ %> <%- + + <% } else if (config.keywords){ %> + + <% } %> <% if (page.description){ %> + + <% } else if (config.description){ %> + + <% } %> + + + <% if (title){ %><%= title %> | <% } %> <%= config.title %> + + <% if (theme.favicon){ %> + + <% } %> + <%- css('css/style') %> <% if (theme.fancybox){ %> <%- css('fancybox/jquery.fancybox.min') %> <% } %> <%- js('/js/pace.min.js') %> - - + + <%- partial('google-analytics') %> + <%- partial('baidu-analytics') %> + + + \ No newline at end of file