feature: 增加 tags 標簽外掛 - label

improvement: 優化 pjax 下 404 頁面
This commit is contained in:
Jerry
2021-04-25 22:08:07 +08:00
parent 597f0d2019
commit aa7173fc69
12 changed files with 90 additions and 75 deletions

View File

@@ -91,6 +91,7 @@ if hexo-config('darkmode.enable') || hexo-config('display_mode') == 'dark'
.hide-button,
.btn-beautify,
.mermaid,
.hl-label,
.post-outdate-notice,
.error-img,
#article-container iframe,

View File

@@ -173,24 +173,15 @@ if hexo-config('readmode')
border: 1px solid var(--gray) !important
.hide-button,
.btn-beautify
.btn-beautify,
.hl-label
border: 1px solid var(--gray) !important
background: var(--readmode-light-color) !important
color: var(--font-color) !important
.btn-beautify
border: 1px solid var(--gray) !important
.button--animated:before
background: var(--readmode-light-color) !important
.hide-inline,
.hide-block
& >.hide-button
border: 1px solid var(--gray)
& > .button--animated:before
background: var(--readmode-light-color)
.note
border: 2px solid var(--gray)
border-left-color: var(--gray) !important

View File

@@ -0,0 +1,11 @@
.hl-label
padding: 2px 4px
border-radius: 3px
color: $btn-color
&.default
background-color: $btn-default-color
for $type in $tagsP-types
&.{$type}
background-color: lookup('$tagsP-' + $type + '-color')

View File

@@ -413,7 +413,11 @@ document.addEventListener('DOMContentLoaded', function () {
const updateAnchor = function (anchor) {
if (window.history.replaceState && anchor !== window.location.hash) {
if (!anchor) anchor = location.pathname
window.history.replaceState({}, '', anchor)
const title = GLOBAL_CONFIG_SITE.title
window.history.replaceState({
url: location.href,
title: title
}, title, anchor)
}
}