From 0d97b24ebec6c77a4fd7952fe676f6d3cceb526e Mon Sep 17 00:00:00 2001 From: thisLight Date: Sat, 1 Jan 2022 17:36:55 +0800 Subject: [PATCH] add cloudflare web analytics and some sweeping --- scripts/cf_analytics.js | 4 +++ source/_data/theme.yaml | 4 +-- themes/cmd/layout/includes/layout.njk | 38 +++++++++------------------ themes/cmd/theme.yaml.example | 22 ++++++++++++++++ 4 files changed, 40 insertions(+), 28 deletions(-) create mode 100644 scripts/cf_analytics.js create mode 100644 themes/cmd/theme.yaml.example diff --git a/scripts/cf_analytics.js b/scripts/cf_analytics.js new file mode 100644 index 0000000..fbf7cd1 --- /dev/null +++ b/scripts/cf_analytics.js @@ -0,0 +1,4 @@ + +hexo.extend.injector.register('body_end', () => { + return ``; +}); diff --git a/source/_data/theme.yaml b/source/_data/theme.yaml index 2e0ed11..5f69d91 100644 --- a/source/_data/theme.yaml +++ b/source/_data/theme.yaml @@ -4,7 +4,7 @@ menu: copyright_addtional: "" -copyright_year_string: "2020-2021" +copyright_year_string: "2020-2022" theme_self_claim: true @@ -32,4 +32,4 @@ topic_rss: prefix: /feeds/by-category/ atom_suffix: /atom.xml rss_suffix: /rss.xml - name_lowercase: true \ No newline at end of file + name_lowercase: true diff --git a/themes/cmd/layout/includes/layout.njk b/themes/cmd/layout/includes/layout.njk index 8844005..9fe5e8a 100644 --- a/themes/cmd/layout/includes/layout.njk +++ b/themes/cmd/layout/includes/layout.njk @@ -18,6 +18,8 @@ {% set pageTitle = config.title %} {% endif %} +{% set theme_data = site.data.theme %} + @@ -37,19 +39,11 @@ diff --git a/themes/cmd/theme.yaml.example b/themes/cmd/theme.yaml.example new file mode 100644 index 0000000..aeddfa5 --- /dev/null +++ b/themes/cmd/theme.yaml.example @@ -0,0 +1,22 @@ + +menu: + Home: / + Archives: /archives + +copyright_addtional: "" + +copyright_year_string: "2020-2021" + +theme_self_claim: true + +about_this_blog: This blog is created with Classical Material Desgin, which try to keep the original taste of Material Design for hexo. + +my_mastodon: https://mastodon.example.com/@example + +footer_links: + Link 1: "https://example.org" + Link 2: "https://example.com" + +# All contents here will be added to the end of body +script_snippets: + # - ""