diff --git a/README.md b/README.md index b7106dd..5d1f197 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,11 @@ cnzz: enable: true url: # +# Google Analytics +google_analytics: '' +# 百度统计 +baidu_analytics: '' + # 数学公式 mathjax: true @@ -226,4 +231,6 @@ 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/_config.yml b/_config.yml index a264009..696286b 100644 --- a/_config.yml +++ b/_config.yml @@ -2,8 +2,9 @@ menu: 主页: / 目录: /archives - 摄影: http://shenyu-vip.lofter.com + 标签: /tags 旅行: /tags/旅行/ + 摄影: http://shenyu-vip.lofter.com 关于我: /2019/about # 网站图标和侧边栏logo @@ -86,6 +87,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 diff --git a/source/css/_partial/footer.styl b/source/css/_partial/footer.styl index 786acfe..f2d6f56 100644 --- a/source/css/_partial/footer.styl +++ b/source/css/_partial/footer.styl @@ -1,6 +1,6 @@ .footer - border-top border-width solid border-color + border-top border-width solid #bbb padding 3rem 0 .outer &>ul diff --git a/source/css/_partial/layout.styl b/source/css/_partial/layout.styl index 2527d6f..c5123fa 100644 --- a/source/css/_partial/layout.styl +++ b/source/css/_partial/layout.styl @@ -63,6 +63,7 @@ padding-left gutter-width margin auto overflow-x hidden + min-height calc( 100% - 157px ) clearfix() .local-search @@ -79,7 +80,6 @@ width wrap-width padding-right 0 padding-left 0 - .local-search width wrap-width 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