add cloudflare web analytics and some sweeping

This commit is contained in:
thisLight 2022-01-01 17:36:55 +08:00
parent e5d64e7153
commit 0d97b24ebe
4 changed files with 40 additions and 28 deletions

4
scripts/cf_analytics.js Normal file
View file

@ -0,0 +1,4 @@
hexo.extend.injector.register('body_end', () => {
return `<!-- Cloudflare Web Analytics --><script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "05f36e0cb3b74781a5755bd4224e252a"}'></script><!-- End Cloudflare Web Analytics -->`;
});

View file

@ -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
name_lowercase: true

View file

@ -18,6 +18,8 @@
{% set pageTitle = config.title %}
{% endif %}
{% set theme_data = site.data.theme %}
<!doctype html>
<html lang="{{ config.language }}">
<head>
@ -37,19 +39,11 @@
<body>
<ul id="nav-mobile" class="sidenav">
{% if site.data.theme.menu %}
{% for key, path in site.data.theme.menu %}
<li>
<a href="{{ path }}">{{ key }}</a>
</li>
{% endfor %}
{% else %}
{% for key, path in theme.menu %}
<li>
<a href="{{ path }}">{{ key }}</a>
</li>
{% endfor %}
{% endif %}
{% for key, path in theme_data.menu %}
<li>
<a href="{{ path }}">{{ key }}</a>
</li>
{% endfor %}
</ul>
<nav class="light-blue lighten-1" role="navigation">
<a href="#" data-target="nav-mobile" class="sidenav-trigger">
@ -57,19 +51,11 @@
</a>
<div class="nav-wrapper">
<ul class="right hide-on-med-and-down">
{% if site.data.theme.menu %}
{% for key, path in site.data.theme.menu %}
<li>
<a href="{{ path }}">{{ key }}</a>
</li>
{% endfor %}
{% else %}
{% for key, path in theme.menu %}
<li>
<a href="{{ path }}">{{ key }}</a>
</li>
{% endfor %}
{% endif %}
{% for key, path in site.data.theme.menu %}
<li>
<a href="{{ path }}">{{ key }}</a>
</li>
{% endfor %}
</ul>
</div>
</nav>

View file

@ -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:
# - "<script> console.log('Hello, friend!'); </script>"