mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-10-04 06:22:00 +08:00
- fix: 修正 Umami Analytics API 參數與資料處理邏輯
- style: 最佳化程式碼高亮工具列顯示與間距設定 - improve: 改善複製工具提示的定位邏輯 - bump: 版本號更新至 5.5.3
This commit is contained in:
1 parent
bdf77e328d
commit
7985bdda9e
4 files changed
+17
-8
No files matched your search
+4
-4
@@ -31,7 +31,7 @@ script.
|
|||||||
const getData = async (isPost) => {
|
const getData = async (isPost) => {
|
||||||
try {
|
try {
|
||||||
const now = Date.now()
|
const now = Date.now()
|
||||||
const keyUrl = isPost ? `&path=${window.location.pathname}` : ''
|
const keyUrl = isPost ? `&url=${window.location.pathname}` : ''
|
||||||
const headerList = { 'Accept': 'application/json' }
|
const headerList = { 'Accept': 'application/json' }
|
||||||
|
|
||||||
if (!{isServerURL}) {
|
if (!{isServerURL}) {
|
||||||
@@ -63,7 +63,7 @@ script.
|
|||||||
if (pagePV) {
|
if (pagePV) {
|
||||||
const data = await getData(true)
|
const data = await getData(true)
|
||||||
if (data && data.pageviews) {
|
if (data && data.pageviews) {
|
||||||
pagePV.textContent = data.pageviews
|
pagePV.textContent = typeof data.pageviews.value !== 'undefined' ? data.pageviews.value : data.pageviews
|
||||||
} else {
|
} else {
|
||||||
console.warn('Umami Analytics: Invalid page view data received')
|
console.warn('Umami Analytics: Invalid page view data received')
|
||||||
}
|
}
|
||||||
@@ -76,7 +76,7 @@ script.
|
|||||||
if (config.site_uv) {
|
if (config.site_uv) {
|
||||||
const siteUV = document.getElementById('umami-site-uv')
|
const siteUV = document.getElementById('umami-site-uv')
|
||||||
if (siteUV && data && data.visitors) {
|
if (siteUV && data && data.visitors) {
|
||||||
siteUV.textContent = data.visitors
|
siteUV.textContent = typeof data.visitors.value !== 'undefined' ? data.visitors.value : data.visitors
|
||||||
} else if (siteUV) {
|
} else if (siteUV) {
|
||||||
console.warn('Umami Analytics: Invalid site UV data received')
|
console.warn('Umami Analytics: Invalid site UV data received')
|
||||||
}
|
}
|
||||||
@@ -85,7 +85,7 @@ script.
|
|||||||
if (config.site_pv) {
|
if (config.site_pv) {
|
||||||
const sitePV = document.getElementById('umami-site-pv')
|
const sitePV = document.getElementById('umami-site-pv')
|
||||||
if (sitePV && data && data.pageviews) {
|
if (sitePV && data && data.pageviews) {
|
||||||
sitePV.textContent = data.pageviews
|
sitePV.textContent = typeof data.pageviews.value !== 'undefined' ? data.pageviews.value : data.pageviews
|
||||||
} else if (sitePV) {
|
} else if (sitePV) {
|
||||||
console.warn('Umami Analytics: Invalid site PV data received')
|
console.warn('Umami Analytics: Invalid site PV data received')
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hexo-theme-butterfly",
|
"name": "hexo-theme-butterfly",
|
||||||
"version": "5.5.2",
|
"version": "5.5.3-b1",
|
||||||
"description": "A Simple and Card UI Design theme for Hexo",
|
"description": "A Simple and Card UI Design theme for Hexo",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -113,6 +113,10 @@ $code-block
|
|||||||
margin: 2px
|
margin: 2px
|
||||||
|
|
||||||
i
|
i
|
||||||
|
display: inline-flex
|
||||||
|
justify-content: center
|
||||||
|
align-items: center
|
||||||
|
padding: 5px
|
||||||
cursor: pointer
|
cursor: pointer
|
||||||
transition: all .3s
|
transition: all .3s
|
||||||
|
|
||||||
@@ -128,7 +132,7 @@ $code-block
|
|||||||
|
|
||||||
if !$highlight_macstyle
|
if !$highlight_macstyle
|
||||||
& > .macStyle
|
& > .macStyle
|
||||||
padding: 0
|
margin: 0
|
||||||
|
|
||||||
.code-lang
|
.code-lang
|
||||||
flex: 1 1 auto
|
flex: 1 1 auto
|
||||||
@@ -182,6 +186,7 @@ if $highlight_macstyle
|
|||||||
.highlight-tools
|
.highlight-tools
|
||||||
.macStyle
|
.macStyle
|
||||||
display: flex
|
display: flex
|
||||||
|
padding: 3px
|
||||||
|
|
||||||
& > *
|
& > *
|
||||||
margin-right: 8px
|
margin-right: 8px
|
||||||
|
|||||||
Loaded 3 of 4 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user