feat: 適配hexo 5.1.0 prismjs caption

feat: code-font-size 也會影響行內代碼塊字體大小 #325
fix: 修復aside recent post的 time 在safari沒有顯示的bug
fix: 修復 prismjs 在 tags-toggle 外掛標簽裏,代碼塊顯示一行的bugs
style: 刪除不必要的css
This commit is contained in:
Jerry
2020-08-22 23:17:28 +08:00
parent ea7eb904fd
commit 4aacafdae1
8 changed files with 33 additions and 29 deletions

View File

@@ -16,7 +16,7 @@
.length_num= site.posts.length .length_num= site.posts.length
if site.tags.length if site.tags.length
.card-info-data-item.is-center .card-info-data-item.is-center
a(href=url_for(config.tag_dir) + '/') a(href=url_for(config.tag_dir) + '/')
.headline= _p('aside.tags') .headline= _p('aside.tags')
.length_num= site.tags.length .length_num= site.tags.length

View File

@@ -63,7 +63,7 @@ function hideToggle (args, content) {
group += '"' group += '"'
return `<div class="hide-toggle" ${border}><div class="hide-button toggle-title" ${group}><i class="fas fa-caret-right fa-fw"></i><span>${display}</span></div> return `<div class="hide-toggle" ${border}><div class="hide-button toggle-title" ${group}><i class="fas fa-caret-right fa-fw"></i><span>${display}</span></div>
<div class="hide-content">${hexo.render.renderSync({ text: content, engine: 'markdown' }).split('\n').join('')}</div></div>` <div class="hide-content">${hexo.render.renderSync({ text: content, engine: 'markdown' })}</div></div>`
} }
hexo.extend.tag.register('hideInline', hideInline) hexo.extend.tag.register('hideInline', hideInline)

View File

@@ -49,6 +49,7 @@ blockquote
#article-container #article-container
pre, pre,
code code
font-size: $code-font-size
font-family: $code-font-family !important font-family: $code-font-family !important
code code
@@ -62,7 +63,6 @@ blockquote
pre pre
@extend $code-block @extend $code-block
padding: 10px 20px padding: 10px 20px
font-size: $code-font-size
code code
padding: 0 padding: 0
@@ -79,6 +79,20 @@ blockquote
padding: 8px 0 padding: 8px 0
border: none border: none
figcaption,
.caption
padding: .3rem 0 .1rem .7rem
font-size: $code-font-size
line-height: 1em
a
float: right
padding-right: 10px
color: $highlight-foreground
&:hover
border-bottom-color: $highlight-foreground
.highlight-tools .highlight-tools
position: relative position: relative
display: flex display: flex
@@ -88,6 +102,7 @@ blockquote
height: 2.15em height: 2.15em
background: $highlight-tools.bg-color background: $highlight-tools.bg-color
color: $highlight-tools.color color: $highlight-tools.color
font-size: $code-font-size
&.closed + table &.closed + table
display: none display: none

View File

@@ -26,20 +26,6 @@ if $highlight_theme != false
padding: 0 padding: 0
border: none border: none
figcaption
clearfix()
padding: .3rem 0 .1rem .7rem
font-size: 1em
line-height: 1em
a
float: right
padding-right: 10px
color: $highlight-foreground
&:hover
border-bottom-color: $highlight-foreground
.gutter pre .gutter pre
padding-right: .5rem padding-right: .5rem
padding-left: .5rem padding-left: .5rem
@@ -51,4 +37,3 @@ if $highlight_theme != false
padding-right: .5rem padding-right: .5rem
padding-left: .5rem padding-left: .5rem
width: 100% width: 100%

View File

@@ -10,4 +10,11 @@ if $highlight_theme != false
background: $highlight-scrollbar background: $highlight-scrollbar
&:not(.line-numbers) &:not(.line-numbers)
padding: 10px 20px padding: 10px 20px
.caption
margin-left: -3.8em
padding: .2rem .8rem !important
a
padding: 0 !important

View File

@@ -138,10 +138,10 @@
& > time & > time
color: $theme-meta-color color: $theme-meta-color
font-size: .85% font-size: 85%
& > .comment & > .comment
font-size: .9% font-size: 90%
& > .title, & > .title,
& > .comment & > .comment

View File

@@ -11,11 +11,6 @@
+maxWidth1024() +maxWidth1024()
display: none display: none
.tocOpenPc
& > #toggle-sidebar
color: #99a9bf
transform: rotateZ(180deg)
#sidebar #sidebar
position: fixed position: fixed
top: 0 top: 0
@@ -27,6 +22,11 @@
background: var(--sidebar-bg) background: var(--sidebar-bg)
opacity: .9 opacity: .9
&.tocOpenPc
& > #toggle-sidebar
color: #99a9bf
transform: rotateZ(180deg)
+maxWidth1024() +maxWidth1024()
right: -($mobile-sidebar-width) right: -($mobile-sidebar-width)
left: auto left: auto

View File

@@ -99,9 +99,6 @@ figure.gallery-group
img img
opacity: 0 opacity: 0
.img-alt
display: none
.fancybox .fancybox
width: auto width: auto
text-align: inherit text-align: inherit