add umami analytics

This commit is contained in:
lianglianglee 2023-04-05 13:22:27 +08:00
parent 5367284355
commit f9a5ec5940
2 changed files with 11 additions and 1 deletions

View File

@ -197,7 +197,11 @@ website_count:
site_uv: false # Option values: true | false site_uv: false # Option values: true | false
site_pv: false # Option values: true | false site_pv: false # Option values: true | false
page_pv: false # Option values: true | false page_pv: false # Option values: true | false
analytics:
umami:
umami_enable : false
umami_src: "http://*******/umami.js"
umami_data_id: "*******"
# --------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------
# Local Search # Local Search
# Docs: https://keep-docs.xpoet.cn/tutorial/configuration-guide/local_search.html # Docs: https://keep-docs.xpoet.cn/tutorial/configuration-guide/local_search.html

View File

@ -7,6 +7,7 @@ const {
const { author: bi_author } = theme.base_info const { author: bi_author } = theme.base_info
const { author: hexo_author } = config const { author: hexo_author } = config
const { site_uv: bsz_site_uv, site_pv: bsz_site_pv, enable: bsz_enable } = theme.website_count.busuanzi_count const { site_uv: bsz_site_uv, site_pv: bsz_site_pv, enable: bsz_enable } = theme.website_count.busuanzi_count
const { umami_enable: umami_enable, umami_src : umami_src, umami_data_id : umami_data_id } = theme.analytics.umami
%> %>
<footer class="footer"> <footer class="footer">
<div class="info-container"> <div class="info-container">
@ -59,5 +60,10 @@ const { site_uv: bsz_site_uv, site_pv: bsz_site_pv, enable: bsz_enable } = theme
<% } %> <% } %>
</div> </div>
<% } %> <% } %>
<% if ( umami_enable === true) { %>
<script async defer data-website-id="<%= umami_data_id %>" src="<%= umami_src %>">
</script>
<% } %>
</div> </div>
</footer> </footer>