highlightjs_theme

This commit is contained in:
xaoxuu 2022-06-07 13:19:56 +08:00
parent e2b3b8901e
commit c5e975e555
3 changed files with 19 additions and 2 deletions

View File

@ -321,6 +321,7 @@ style:
background: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.2/avatar/round/rainbow64@3x.webp background: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.2/avatar/round/rainbow64@3x.webp
codeblock: codeblock:
scrollbar: 4px scrollbar: 4px
highlightjs_theme: https://fastly.jsdelivr.net/gh/highlightjs/cdn-release@11.5.0/build/styles/atom-one-dark.min.css
default: default:
avatar: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/avatar/round/3442075.svg avatar: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/avatar/round/3442075.svg

View File

@ -82,6 +82,11 @@ function og_args() {
<%- favicon_tag(config.favicon) %> <%- favicon_tag(config.favicon) %>
<% } %> <% } %>
<% if (config.highlight && config.highlight.enable == true && config.highlight.hljs == true) { %>
<%- css(theme.style.codeblock.highlightjs_theme) %>
<% } %>
<% if (config.inject && config.inject.head){ %> <% if (config.inject && config.inject.head){ %>
<% (config.inject.head||[]).forEach(function(item){ %> <% (config.inject.head||[]).forEach(function(item){ %>
<%- item %> <%- item %>

View File

@ -78,6 +78,17 @@ article.md .highlight
table:not([class]) table:not([class])
border-collapse: collapse border-collapse: collapse
article.md pre
>.caption
color: var(--text-p3)
>.hljs
padding: 1rem
border-radius: $border-block
border: 1px solid var(--block-border)
line-height: 1.5
box-sizing: border-box
article.md .highlight article.md .highlight
.code .code
vertical-align: top vertical-align: top