mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-10 21:17:07 +08:00
Merge branch 'dev' of https://github.com/jerryc127/hexo-theme-butterfly into dev
This commit is contained in:
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
@@ -10,4 +10,4 @@ liberapay: # Replace with a single Liberapay username
|
|||||||
issuehunt: # Replace with a single IssueHunt username
|
issuehunt: # Replace with a single IssueHunt username
|
||||||
otechie: # Replace with a single Otechie username
|
otechie: # Replace with a single Otechie username
|
||||||
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
||||||
custom: ['https://buy.stripe.com/3cs6rP6YA91sbbG5kk','https://jsd.012700.xyz/gh/jerryc127/CDN/Photo/wechat.jpg'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
custom: ['https://buy.stripe.com/3cs6rP6YA91sbbG5kk'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||||
|
|||||||
@@ -699,6 +699,7 @@ umami_analytics:
|
|||||||
enable: false
|
enable: false
|
||||||
# For self-hosted setups, configure the hostname of the Umami instance
|
# For self-hosted setups, configure the hostname of the Umami instance
|
||||||
serverURL:
|
serverURL:
|
||||||
|
script_name: script.js
|
||||||
website_id:
|
website_id:
|
||||||
option:
|
option:
|
||||||
UV_PV:
|
UV_PV:
|
||||||
|
|||||||
8
layout/includes/third-party/pjax.pug
vendored
8
layout/includes/third-party/pjax.pug
vendored
@@ -29,7 +29,13 @@ script.
|
|||||||
|
|
||||||
const triggerPjaxFn = (val) => {
|
const triggerPjaxFn = (val) => {
|
||||||
if (!val) return
|
if (!val) return
|
||||||
Object.values(val).forEach(fn => fn())
|
Object.values(val).forEach(fn => {
|
||||||
|
try {
|
||||||
|
fn()
|
||||||
|
} catch (err) {
|
||||||
|
console.debug('Pjax callback failed:', err)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener('pjax:send', () => {
|
document.addEventListener('pjax:send', () => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
- let { serverURL, website_id, option, UV_PV } = theme.umami_analytics
|
- let { serverURL, script_name, website_id, option, UV_PV } = theme.umami_analytics
|
||||||
- const isServerURL = !!serverURL
|
- const isServerURL = !!serverURL
|
||||||
- const baseURL = serverURL ? serverURL.replace(/\/$/, '') : 'https://cloud.umami.is'
|
- const baseURL = serverURL ? serverURL.replace(/\/$/, '') : 'https://cloud.umami.is'
|
||||||
- const apiUrl = serverURL ? serverURL.replace(/\/$/, '') + '/api' : 'https://api.umami.is/v1'
|
- const apiUrl = serverURL ? serverURL.replace(/\/$/, '') + '/api' : 'https://api.umami.is/v1'
|
||||||
@@ -17,7 +17,7 @@ script.
|
|||||||
}
|
}
|
||||||
|
|
||||||
const loadUmamiJS = () => {
|
const loadUmamiJS = () => {
|
||||||
btf.getScript('!{baseURL}/script.js', {
|
btf.getScript('!{baseURL}/!{script_name}', {
|
||||||
'data-website-id': '!{website_id}',
|
'data-website-id': '!{website_id}',
|
||||||
'data-auto-track': 'false',
|
'data-auto-track': 'false',
|
||||||
...option
|
...option
|
||||||
|
|||||||
@@ -404,6 +404,7 @@ module.exports = {
|
|||||||
umami_analytics: {
|
umami_analytics: {
|
||||||
enable: false,
|
enable: false,
|
||||||
serverURL: null,
|
serverURL: null,
|
||||||
|
script_name: 'script.js',
|
||||||
website_id: null,
|
website_id: null,
|
||||||
option: null,
|
option: null,
|
||||||
UV_PV: {
|
UV_PV: {
|
||||||
|
|||||||
Reference in New Issue
Block a user