parent
9c5c1e6e48
commit
a092bdbcd8
11 changed files with 232 additions and 89 deletions
@ -0,0 +1,5 @@ |
||||
<%- partial('_pre') %> |
||||
<div class='l_main no_sidebar'> |
||||
<%- partial('_partial/article', {post: page, index: false}) %> |
||||
</div> |
||||
<%- partial('_partial/footer', null, {cache: !config.relative_link}) %> |
@ -0,0 +1,7 @@ |
||||
hexo.extend.generator.register('404', function(locals){ |
||||
return { |
||||
path: '404.html', |
||||
data: locals.posts, |
||||
layout: ['404'] |
||||
} |
||||
}); |
@ -0,0 +1,27 @@ |
||||
const url_for = require('hexo-util').url_for.bind(hexo); |
||||
|
||||
function gallery(args, content) { |
||||
return `<div class="justified-gallery">${hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')}
|
||||
</div>`; |
||||
} |
||||
|
||||
function galleryGroup(args){ |
||||
const name = args[0] |
||||
const desrc = args[1] |
||||
const url = url_for(args[2]) |
||||
const img = url_for(args[3]) |
||||
|
||||
return ` |
||||
<figure class="gallery-group"> |
||||
<img class="gallery-group-img" src='${img}'> |
||||
<figcaption> |
||||
<div class="gallery-group-name">${name}</div> |
||||
<p>${desrc}</p> |
||||
<a href='${url}'></a> |
||||
</figcaption> |
||||
</figure> |
||||
` |
||||
} |
||||
|
||||
hexo.extend.tag.register('gallery', gallery, {ends: true}); |
||||
hexo.extend.tag.register('galleryGroup', galleryGroup); |
@ -0,0 +1,33 @@ |
||||
|
||||
/** |
||||
* {% hideInline content,display,bg,color %} |
||||
* content不能包含當引號,可用 ' |
||||
*/ |
||||
function hideInline(args) { |
||||
args = args.join(' ').split(',') |
||||
let content = args[0].trim() |
||||
let display = args[1] || 'Click' |
||||
let bg = args[2] ==='' || typeof args[2] ==='undefined' ? '' : `background-color:${args[2]}` |
||||
let color = args[3] || '#fff' |
||||
return `<span class="hide-inline"><a class="hide-button button--primary button--animated" style="color:${color};${bg}">${display} |
||||
</a><span class="hide-content">${content}</span></span>` |
||||
} |
||||
|
||||
/** |
||||
* {% hideBlock display,bg,color %} |
||||
* content |
||||
* {% endhideBlock %} |
||||
*/ |
||||
function hideBlock(args,content) { |
||||
args = args.join(' ').split(',') |
||||
let display = args[0] || 'Click' |
||||
let bg = args[1] ==='' || typeof args[2] ==='undefined' ? '' : `background-color:${args[2]}` |
||||
let color = args[2] || '#fff' |
||||
|
||||
return `<div class="hide-block"><a class="hide-button button--primary button--animated" style="color:${color};${bg}">${display} |
||||
</a><span class="hide-content">${hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')}</span></div>` |
||||
|
||||
} |
||||
|
||||
hexo.extend.tag.register('hideInline', hideInline); |
||||
hexo.extend.tag.register('hideBlock', hideBlock, {ends: true}); |
@ -0,0 +1,7 @@ |
||||
function mermaid(args, content) { |
||||
return `<div class="mermaid">
|
||||
${content} |
||||
</div>`; |
||||
} |
||||
|
||||
hexo.extend.tag.register('mermaid', mermaid, {ends: true}); |
@ -0,0 +1,15 @@ |
||||
/** |
||||
* note.js |
||||
* transplant from hexo-theme-next |
||||
*/ |
||||
|
||||
'use strict'; |
||||
|
||||
function postNote(args, content) { |
||||
return `<div class="note ${args.join(' ')}">
|
||||
${hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')} |
||||
</div>`; |
||||
} |
||||
|
||||
hexo.extend.tag.register('note', postNote, {ends: true}); |
||||
hexo.extend.tag.register('subnote', postNote, {ends: true}); |
@ -0,0 +1,135 @@ |
||||
div.note |
||||
$border-codeblock = 4px |
||||
bg($c) |
||||
return mix($c, $color-card, 10) |
||||
border($c) |
||||
return mix($c, $color-card, 80) |
||||
position: relative |
||||
margin-top: $gap-line |
||||
margin-bottom: $gap-line |
||||
padding: $gap-inline $gap |
||||
padding-left: "calc(16px + %s)" % $gap |
||||
border-radius: $border-codeblock |
||||
|
||||
h2, |
||||
h3, |
||||
h4, |
||||
h5, |
||||
h6 |
||||
if $note-icons |
||||
margin-top: 3px |
||||
else |
||||
margin-top: 0 |
||||
|
||||
margin-bottom: 0 |
||||
padding-top: 0 !important |
||||
border-bottom: initial |
||||
|
||||
p, |
||||
ul, |
||||
ol, |
||||
table, |
||||
pre, |
||||
blockquote, |
||||
img |
||||
font-size: $fontsize-list |
||||
margin-top: $gap-inline |
||||
margin-bottom: $gap-inline |
||||
|
||||
&::before |
||||
position: absolute |
||||
top: "calc(50% - %s * 0.5)" % (24px) |
||||
left 4px |
||||
width: 24px |
||||
height: 24px |
||||
text-align: center |
||||
font-weight: 600 |
||||
line-height: 24px |
||||
vertical-align: middle |
||||
font-family: 'Font Awesome 5 Free' |
||||
|
||||
background: bg($color-text) |
||||
border-left: $border-codeblock solid border($color-text) |
||||
&::before |
||||
color: border($color-text) |
||||
content: '\f10d' |
||||
&.info |
||||
background: bg($color-mac-cyan) |
||||
border-color: border($color-mac-cyan) |
||||
&::before |
||||
color: border($color-mac-cyan) |
||||
content: '\f129' |
||||
&.success,&.done |
||||
background: bg($color-mac-green) |
||||
border-color: border($color-mac-green) |
||||
&::before |
||||
color: border($color-mac-green) |
||||
content: '\f00c' |
||||
&.warning |
||||
background: bg($color-mac-yellow) |
||||
border-color: border($color-mac-yellow) |
||||
&::before |
||||
color: border($color-mac-yellow) |
||||
content: '\f12a' |
||||
&.danger,&.error |
||||
background: bg($color-mac-red) |
||||
border-color: border($color-mac-red) |
||||
&::before |
||||
color: border($color-mac-red) |
||||
content: '\f00d' |
||||
&.radiation::before |
||||
content: '\f7b9' |
||||
&.bug::before |
||||
content: '\f188' |
||||
&.idea::before |
||||
content: '\f0eb' |
||||
&.link::before |
||||
content: '\f0c1' |
||||
&.paperclip::before |
||||
content: '\f0c6' |
||||
&.todo::before |
||||
content: '\f0ae' |
||||
&.msg::before |
||||
content: '\f4ad' |
||||
&.guide::before |
||||
content: '\f277' |
||||
&.download::before |
||||
content: '\f019' |
||||
|
||||
|
||||
|
||||
&.light |
||||
background: mix($color-text, $color-card, 5) |
||||
border-left-color: mix($color-text, $color-card, 50) |
||||
&::before |
||||
color: mix($color-text, $color-card, 50) |
||||
&.gray |
||||
background: bg($color-text) |
||||
border-color: border($color-text) |
||||
&::before |
||||
color: border($color-text) |
||||
&.red |
||||
background: bg($color-mac-red) |
||||
border-color: border($color-mac-red) |
||||
&::before |
||||
color: border($color-mac-red) |
||||
&.yellow |
||||
background: bg($color-mac-yellow) |
||||
border-color: border($color-mac-yellow) |
||||
&::before |
||||
color: border($color-mac-yellow) |
||||
&.green |
||||
background: bg($color-mac-green) |
||||
border-color: border($color-mac-green) |
||||
&::before |
||||
color: border($color-mac-green) |
||||
&.cyan |
||||
background: bg($color-mac-cyan) |
||||
border-color: border($color-mac-cyan) |
||||
&::before |
||||
color: border($color-mac-cyan) |
||||
&.blue |
||||
background: bg($color-md-blue) |
||||
border-color: border($color-md-blue) |
||||
&::before |
||||
color: border($color-md-blue) |
@ -1,87 +0,0 @@ |
||||
.article-entry |
||||
div.info |
||||
background-color: alpha($color-mac-cyan, 20%) |
||||
border-left: $border-codeblock solid $color-mac-cyan |
||||
border-radius: $border-codeblock |
||||
// >:before |
||||
// content: " " |
||||
// position: absolute |
||||
// top: 50% |
||||
// left: -14.5px |
||||
// margin-top: -12px |
||||
// width: 24px |
||||
// height: 24px |
||||
// border-radius: 50% |
||||
// text-align: center |
||||
// color: white |
||||
// background-size: 16px 16px |
||||
// background-position: 4px 4px |
||||
// background-repeat: no-repeat |
||||
// background-color: $color-mac-cyan |
||||
// background-image: url("data:image/svg+xmlbase64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHdpZHRoPSIxNzkyIiBoZWlnaHQ9IjE3OTIiIHZpZXdCb3g9IjAgMCAxNzkyIDE3OTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyMTYgMTM0NHYxMjhxMCAyNi0xOSA0NXQtNDUgMTloLTUxMnEtMjYgMC00NS0xOXQtMTktNDV2LTEyOHEwLTI2IDE5LTQ1dDQ1LTE5aDY0di0zODRoLTY0cS0yNiAwLTQ1LTE5dC0xOS00NXYtMTI4cTAtMjYgMTktNDV0NDUtMTloMzg0cTI2IDAgNDUgMTl0MTkgNDV2NTc2aDY0cTI2IDAgNDUgMTl0MTkgNDV6bS0xMjgtMTE1MnYxOTJxMCAyNi0xOSA0NXQtNDUgMTloLTI1NnEtMjYgMC00NS0xOXQtMTktNDV2LTE5MnEwLTI2IDE5LTQ1dDQ1LTE5aDI1NnEyNiAwIDQ1IDE5dDE5IDQ1eiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==") |
||||
|
||||
div.success |
||||
background-color: alpha($color-mac-green, 20%) |
||||
border-left: $border-codeblock solid $color-mac-green |
||||
border-radius: $border-codeblock |
||||
// >:before |
||||
// content: " " |
||||
// position: absolute |
||||
// top: 50% |
||||
// left: -14.5px |
||||
// margin-top: -12px |
||||
// width: 24px |
||||
// height: 24px |
||||
// border-radius: 50% |
||||
// text-align: center |
||||
// color: #fff |
||||
// background-size: 16px 16px |
||||
// background-position: 4px 4px |
||||
// background-repeat: no-repeat |
||||
// background-color: $color-mac-green |
||||
// background-image: url("data:image/svg+xmlbase64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNjcxIDU2NnEwIDQwLTI4IDY4bC03MjQgNzI0LTEzNiAxMzZxLTI4IDI4LTY4IDI4dC02OC0yOGwtMTM2LTEzNi0zNjItMzYycS0yOC0yOC0yOC02OHQyOC02OGwxMzYtMTM2cTI4LTI4IDY4LTI4dDY4IDI4bDI5NCAyOTUgNjU2LTY1N3EyOC0yOCA2OC0yOHQ2OCAyOGwxMzYgMTM2cTI4IDI4IDI4IDY4eiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==") |
||||
|
||||
|
||||
div.warning |
||||
background-color: alpha($color-mac-yellow, 20%) |
||||
border-left: $border-codeblock solid $color-mac-yellow |
||||
border-radius: $border-codeblock |
||||
// >:before |
||||
// content: " " |
||||
// position: absolute |
||||
// top: 50% |
||||
// left: -14.5px |
||||
// margin-top: -12px |
||||
// width: 24px |
||||
// height: 24px |
||||
// border-radius: 50% |
||||
// text-align: center |
||||
// color: #fff |
||||
// background-size: 16px 16px |
||||
// background-position: 4px 4px |
||||
// background-repeat: no-repeat |
||||
// background-color: $color-mac-yellow |
||||
// background-image: url("data:image/svg+xmlbase64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xMDg4IDEyNTZ2MjQwcTAgMTYtMTIgMjh0LTI4IDEyaC0yNDBxLTE2IDAtMjgtMTJ0LTEyLTI4di0yNDBxMC0xNiAxMi0yOHQyOC0xMmgyNDBxMTYgMCAyOCAxMnQxMiAyOHptMzE2LTYwMHEwIDU0LTE1LjUgMTAxdC0zNSA3Ni41LTU1IDU5LjUtNTcuNSA0My41LTYxIDM1LjVxLTQxIDIzLTY4LjUgNjV0LTI3LjUgNjdxMCAxNy0xMiAzMi41dC0yOCAxNS41aC0yNDBxLTE1IDAtMjUuNS0xOC41dC0xMC41LTM3LjV2LTQ1cTAtODMgNjUtMTU2LjV0MTQzLTEwOC41cTU5LTI3IDg0LTU2dDI1LTc2cTAtNDItNDYuNS03NHQtMTA3LjUtMzJxLTY1IDAtMTA4IDI5LTM1IDI1LTEwNyAxMTUtMTMgMTYtMzEgMTYtMTIgMC0yNS04bC0xNjQtMTI1cS0xMy0xMC0xNS41LTI1dDUuNS0yOHExNjAtMjY2IDQ2NC0yNjYgODAgMCAxNjEgMzF0MTQ2IDgzIDEwNiAxMjcuNSA0MSAxNTguNXoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=") |
||||
|
||||
|
||||
|
||||
div.danger |
||||
background-color: alpha($color-mac-red, 20%) |
||||
border-left: $border-codeblock solid $color-mac-red |
||||
border-radius: $border-codeblock |
||||
// >:before |
||||
// content: " " |
||||
// position: absolute |
||||
// top: 50% |
||||
// left: -14.5px |
||||
// margin-top: -12px |
||||
// width: 24px |
||||
// height: 24px |
||||
// border-radius: 50% |
||||
// text-align: center |
||||
// color: #fff |
||||
// background-size: 16px 16px |
||||
// background-position: 4px 4px |
||||
// background-repeat: no-repeat |
||||
// background-color: $color-mac-red |
||||
// background-image: url("data:image/svg+xmlbase64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xMDg4IDEyNDh2MjI0cTAgMjYtMTkgNDV0LTQ1IDE5aC0yNTZxLTI2IDAtNDUtMTl0LTE5LTQ1di0yMjRxMC0yNiAxOS00NXQ0NS0xOWgyNTZxMjYgMCA0NSAxOXQxOSA0NXptMzAtMTA1NmwtMjggNzY4cS0xIDI2LTIwLjUgNDV0LTQ1LjUgMTloLTI1NnEtMjYgMC00NS41LTE5dC0yMC41LTQ1bC0yOC03NjhxLTEtMjYgMTcuNS00NXQ0NC41LTE5aDMyMHEyNiAwIDQ0LjUgMTl0MTcuNSA0NXoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=") |
Loading…
Reference in new issue