From 5b3c45910d1fbef89b1589d0f2e7eb24a485cc68 Mon Sep 17 00:00:00 2001 From: thisLight Date: Mon, 28 Dec 2020 10:04:32 +0800 Subject: [PATCH] update theme --- themes/cmd/_config.yml | 2 + themes/cmd/layout/index.swig | 10 +-- themes/cmd/layout/post.swig | 13 +++- themes/cmd/source/css/entry.css | 1 + themes/cmd/source/css/xcode.css | 106 ++++++++++++++++++++++++++++++++ 5 files changed, 126 insertions(+), 6 deletions(-) create mode 100644 themes/cmd/source/css/entry.css create mode 100644 themes/cmd/source/css/xcode.css diff --git a/themes/cmd/_config.yml b/themes/cmd/_config.yml index efa5aed..93227b9 100644 --- a/themes/cmd/_config.yml +++ b/themes/cmd/_config.yml @@ -14,6 +14,8 @@ stylesheets: - /css/cmd.css - /materialize/css/materialize.css - /css/materialdesignicons.min.css +- /css/entry.css +- /css/xcode.css # scripts loaded in the end of the body scripts: diff --git a/themes/cmd/layout/index.swig b/themes/cmd/layout/index.swig index 86d1419..9b0d65f 100644 --- a/themes/cmd/layout/index.swig +++ b/themes/cmd/layout/index.swig @@ -24,7 +24,7 @@
{{ PostTags(post) }} {% if post.excerpt != "" %} -

{{ post.excerpt }}

+

{{ post.excerpt }}

{% endif %}
{% endif %} @@ -34,7 +34,7 @@ {% else %}
{% if (post.title != '' && post.title !== null && post.title !== undefined) %}{{ post.title }}{% else %}{{ post.path }}{% endif %} -

{{ post.excerpt }}

+

{{ post.excerpt }}

{{ PostTags(post) }}
{% endif %} @@ -48,11 +48,11 @@
{% if email %} -
+
{% else %} -
+
{% endif %} @@ -67,7 +67,7 @@ {% endmacro %} {% macro TagPanel(tags) %} -
+
All Tags
{% for tag in tags %}
diff --git a/themes/cmd/layout/post.swig b/themes/cmd/layout/post.swig index 3e80a8f..cdf8345 100644 --- a/themes/cmd/layout/post.swig +++ b/themes/cmd/layout/post.swig @@ -1,5 +1,15 @@ {% extends 'includes/layout.swig' %} +{% macro PostTags(post) %} + +{% endmacro %} + {% macro Gallery(photos) %}
@@ -21,10 +31,11 @@
{{date(page.date, 'YYYY/M/D')}}
+ {{ PostTags(page) }} {% if page.photos && page.photos.length > 0%} {{Gallery(page.photos)}} {% endif %} -
+
{% autoescape false %}{{ page.content }}{% endautoescape %}
diff --git a/themes/cmd/source/css/entry.css b/themes/cmd/source/css/entry.css new file mode 100644 index 0000000..5e484bd --- /dev/null +++ b/themes/cmd/source/css/entry.css @@ -0,0 +1 @@ +body{padding:0;margin:0}.entry{margin-top:0;margin-bottom:0;margin-left:0;margin-left:auto;margin-right:auto;max-width:640px;padding:0 16px;line-height:2;color:#424b50;word-wrap:break-word;font-size:16px;font-family:"Helvetica Neue",Arial,"Hiragino Sans GB","Hiragino Sans GB W3","Microsoft YaHei","Wenquanyi Micro Hei",sans-serif;-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;counter-reset:entry825h2 entry825h3 entry825h4 entry825h5 entry825h6}.entry div,.entry p,.entry blockquote,.entry pre,.entry ul,.entry ol,.entry table,.entry figure,.entry section,.entry article,.entry header,.entry footer{margin:0;padding:0;margin-top:16px;margin-bottom:16px}.entry div:first-child,.entry p:first-child,.entry blockquote:first-child,.entry pre:first-child,.entry ul:first-child,.entry ol:first-child,.entry table:first-child,.entry figure:first-child,.entry section:first-child,.entry article:first-child,.entry header:first-child,.entry footer:first-child{margin-top:0}.entry div:last-child,.entry p:last-child,.entry blockquote:last-child,.entry pre:last-child,.entry ul:last-child,.entry ol:last-child,.entry table:last-child,.entry figure:last-child,.entry section:last-child,.entry article:last-child,.entry header:last-child,.entry footer:last-child{margin-bottom:0}.entry ul div,.entry ol div,.entry ul p,.entry ol p,.entry ul blockquote,.entry ol blockquote,.entry ul pre,.entry ol pre,.entry ul ul,.entry ol ul,.entry ul ol,.entry ol ol,.entry ul table,.entry ol table,.entry ul figure,.entry ol figure,.entry ul iframe,.entry ol iframe,.entry ul section,.entry ol section,.entry ul article,.entry ol article,.entry ul header,.entry ol header,.entry ul footer,.entry ol footer{margin-top:0;margin-bottom:0}.entry>iframe{display:block;margin-top:16px;margin-bottom:16px}.entry>img,.entry>video{margin-top:16px;margin-bottom:16px;display:block}.entry h1,.entry h2,.entry h3,.entry h4,.entry h5,.entry h6{margin-top:0;margin-bottom:0;padding:0}.entry h1:first-child,.entry h2:first-child,.entry h3:first-child,.entry h4:first-child,.entry h5:first-child,.entry h6:first-child{margin-top:0}.entry>h3,.entry>h4,.entry>h5,.entry>h6{margin-top:32px}.entry>h1,.entry>h2{margin-top:64px}.entry h1+*,.entry h2+*,.entry h3+*,.entry h4+*,.entry h5+*,.entry h6+*{margin-top:0}.entry h1,.entry h2,.entry h3,.entry h4,.entry h5,.entry h6{font-weight:inherit;color:#424b50;background-color:transparent}.entry h1 a,.entry h2 a,.entry h3 a,.entry h4 a,.entry h5 a,.entry h6 a{color:#424b50}.entry h1 a,.entry h2 a,.entry h3 a,.entry h4 a,.entry h5 a,.entry h6 a,.entry h1 em,.entry h2 em,.entry h3 em,.entry h4 em,.entry h5 em,.entry h6 em,.entry h1 u,.entry h2 u,.entry h3 u,.entry h4 u,.entry h5 u,.entry h6 u,.entry h1 abbr[title],.entry h2 abbr[title],.entry h3 abbr[title],.entry h4 abbr[title],.entry h5 abbr[title],.entry h6 abbr[title]{border-bottom-color:#424b50}.entry h1{font-size:28px;line-height:48px;text-align:center}.entry h2{font-size:21px;line-height:32px;text-align:left}.entry h3{font-size:18px;line-height:32px;text-align:left}.entry h4,.entry h5,.entry h6{line-height:32px;font-size:16px;text-align:left}.entry blockquote{position:relative;padding:0 0 0 11px;margin:16px 0;font-family:Georgia,'Times New Roman',STKaiti,BiauKai,KaiTi,'DFKai-SB','KaiTi_GB2312',serif;border-left:5px solid #c3cace}.entry li blockquote{margin-left:-21px}.entry pre{padding:15px 16px;line-height:16px;font-size:14px;white-space:pre;word-wrap:normal;overflow:auto;font-family:consolas,monaco,monospace;border:1px solid #e1e1e8;border-right:none;border-left:none;background-color:#f7f7f9}.entry ul,.entry ol{padding-left:32px}.entry ul li,.entry ol li{margin:0;padding:0;list-style-position:outside}.entry ul li{list-style-type:square}.entry ul li ul li{list-style-type:disc}.entry ul li ul li ul li{list-style-type:circle}.entry ol li{list-style-type:decimal}.entry ol li ol li{list-style-type:upper-roman}.entry ol li ol li ol li{list-style-type:lower-roman}.entry li>ul,.entry li>ol{padding-left:32px}.entry hr{position:relative;padding-top:32px;margin-top:-2px;margin-bottom:64px;height:0;background:none;border:none;border-bottom:2px dashed #888}.entry hr:before,.entry hr:after{content:'';position:absolute;bottom:-2px;width:30%;height:2px;pointer-events:none}.entry hr:before{left:0;background-image:-webkit-linear-gradient(right, rgba(255,255,255,0) 0, white 80%, white 100%);background-image:-moz-linear-gradient(right, rgba(255,255,255,0) 0, white 80%, white 100%);background-image:-ms-linear-gradient(right, rgba(255,255,255,0) 0, white 80%, white 100%);background-image:-o-linear-gradient(right, rgba(255,255,255,0) 0, white 80%, white 100%);background-image:linear-gradient(right, rgba(255,255,255,0) 0, white 80%, white 100%)}.entry hr:after{right:0;background-image:-webkit-linear-gradient(left, rgba(255,255,255,0) 0, white 80%, white 100%);background-image:-moz-linear-gradient(left, rgba(255,255,255,0) 0, white 80%, white 100%);background-image:-ms-linear-gradient(left, rgba(255,255,255,0) 0, white 80%, white 100%);background-image:-o-linear-gradient(left, rgba(255,255,255,0) 0, white 80%, white 100%);background-image:linear-gradient(left, rgba(255,255,255,0) 0, white 80%, white 100%)}.entry table{display:table;padding:0;margin-left:auto;margin-right:auto;min-width:336px;border-collapse:collapse;border-spacing:0;-webkit-border-radius:.5em;-moz-border-radius:.5em;-ms-border-radius:.5em;-o-border-radius:.5em;border-radius:.5em}.entry table caption{padding:0}.entry table thead th{text-align:left}.entry table tbody{margin:0 16px}.entry table tbody tr:nth-child(odd) td,.entry table tbody tr:nth-child(odd) th{background-color:#f9f9f9}.entry table tbody tr:last-child td,.entry table tbody tr:last-child th{padding-bottom:6px}.entry table td,.entry table th{padding:8px 16px 7px;border:1px solid #ddd}.entry iframe{vertical-align:text-bottom}.entry a{padding-bottom:.025em;color:#069;text-decoration:none;border-bottom-color:#08c}.entry a:focus{outline:thin dotted}.entry a:visited{color:#551a8b;border-bottom-color:#551a8b}.entry a:hover{border-bottom-width:1px;border-bottom-style:solid}.entry a:hover,.entry a:active{outline:0}.entry b,.entry strong{font-weight:bold}.entry u{padding-bottom:.05em;font-style:inherit;font-weight:inherit;text-decoration:inherit;border-bottom:1px solid #8b98a0}.entry u+u{margin-left:.125em}.entry em{font-style:inherit;font-weight:inherit;text-decoration:inherit;-webkit-text-emphasis:filled circle;-moz-text-emphasis:filled circle;-ms-text-emphasis:filled circle;text-emphasis:filled circle;-webkit-text-emphasis-position:under;-moz-text-emphasis-position:under;-ms-text-emphasis-position:under;text-emphasis-position:under}.entry code{font-family:monospace;font-size:inherit;color:#424b50;background-color:transparent}.entry pre code{padding:0;margin:0;font-family:consolas,monaco,monospace;font-size:14px;color:#424b50;background:none;border:none}.entry img,.entry video{max-width:100%;border:0}.entry figure img{display:block;margin:0 auto}.entry figure figcaption{display:block;text-align:center;font-style:italic}.entry cite{font-style:inherit}.entry cite:before,.entry cite:after{content:"\300a";line-height:inherit}.entry cite:after{content:"\300b"}.entry abbr[title]{padding-bottom:.05em;cursor:help;border-bottom:1px dotted #424b50}.entry dfn{font-style:italic}.entry mark{background:yellow;color:#424b50}.entry q{quotes:"\201C" "\201D" "\2018" "\2019"}.entry small{font-size:80%}.entry sub,.entry sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.entry sup{top:-0.5em}.entry sub{bottom:-0.25em}.entry #disqus_thread{margin-top:32px}.entry h2:before,.entry h3:before,.entry h4:before,.entry h5:before,.entry h6:before{color:inherit}.entry h2{counter-reset:entry825h3 entry825h4 entry825h5 entry825h6}.entry h2:before{content:counter(entry825h2) '\3000';content:counter(entry825h2, cjk-ideographic) '\3001';counter-increment:entry825h2}.entry h3{counter-reset:entry825h4 entry825h5 entry825h6}.entry h3:before{content:counter(entry825h2) '.' counter(entry825h3) '\3000';counter-increment:entry825h3}.entry h4{counter-reset:entry825h5 entry825h6}.entry h4:before{content:counter(entry825h2) '.' counter(entry825h3) '.' counter(entry825h4) '\3000';counter-increment:entry825h4}.entry h5{counter-reset:entry825h6}.entry h5:before{content:counter(entry825h2) '.' counter(entry825h3) '.' counter(entry825h4) '.' counter(entry825h5) '\3000';counter-increment:entry825h5}.entry h6:before{content:counter(entry825h2) '.' counter(entry825h3) '.' counter(entry825h4) '.' counter(entry825h5) '.' counter(entry825h6) '\3000';counter-increment:entry825h6} \ No newline at end of file diff --git a/themes/cmd/source/css/xcode.css b/themes/cmd/source/css/xcode.css new file mode 100644 index 0000000..23e888b --- /dev/null +++ b/themes/cmd/source/css/xcode.css @@ -0,0 +1,106 @@ +/* + +XCode style (c) Angel Garcia + +Ported to Hexo highlight.js system by Rubicon + +*/ + +.highlight { + display: block; + overflow-x: auto; + padding: 0.5em; + background: #fff; + color: black; +} + +/* Gray DOCTYPE selectors like WebKit */ +.code .xml .meta { + color: #c0c0c0; +} + +.code .comment, +.code .quote { + color: #007400; +} + +.code .tag, +.code .attribute, +.code .keyword, +.code .selector-tag, +.code .literal, +.code .name { + color: #aa0d91; +} + +.code .variable, +.code .template-variable { + color: #3F6E74; +} + +.code .code, +.code .string, +.code .meta-string { + color: #c41a16; +} + +.code .regexp, +.code .link { + color: #0E0EFF; +} + +.code .title, +.code .symbol, +.code .bullet, +.code .number { + color: #1c00cf; +} + +.code .section, +.code .meta { + color: #643820; +} + + +.code .class .title, +.code .type, +.code .built_in, +.code .builtin-name, +.code .params { + color: #5c2699; +} + +.code .attr { + color: #836C28; +} + +.code .subst { + color: #000; +} + +.code .formula { + background-color: #eee; + font-style: italic; +} + +.code .addition { + background-color: #baeeba; +} + +.code .deletion { + background-color: #ffc8bd; +} + +.code .selector-id, +.code .selector-class { + color: #9b703f; +} + +.code .doctag, +.code .strong { + font-weight: bold; +} + +.code .emphasis { + font-style: italic; +}