From be39d848797a1e68c4f6887f55b478b408bf9430 Mon Sep 17 00:00:00 2001 From: Phan An Date: Tue, 29 Jan 2019 17:35:40 +0100 Subject: [PATCH 1/5] Use highlight.js for more semantics --- _config.yml | 1 + package.json | 2 +- themes/vue/source/css/_syntax.styl | 154 +++++++++++++++-------------- 3 files changed, 83 insertions(+), 74 deletions(-) diff --git a/_config.yml b/_config.yml index 3c5d26a12b..a0ba1bd4c2 100644 --- a/_config.yml +++ b/_config.yml @@ -39,6 +39,7 @@ highlight: enable: true line_number: false tab_replace: + hljs: true # Category & Tag default_category: uncategorized diff --git a/package.json b/package.json index e3640cc3fa..42cf1a17c9 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vuejs.org", "private": true, "hexo": { - "version": "3.8.0" + "version": "3.7.1" }, "scripts": { "start": "hexo server", diff --git a/themes/vue/source/css/_syntax.styl b/themes/vue/source/css/_syntax.styl index f756d07e50..002c729140 100644 --- a/themes/vue/source/css/_syntax.styl +++ b/themes/vue/source/css/_syntax.styl @@ -1,77 +1,85 @@ .gutter pre color: #999 -pre +pre code color: #525252 - .function .keyword, - .constant - color: #0092db - .keyword, - .attribute - color: #e96900 - .number, - .literal - color: #AE81FF - .tag, - .tag .title, - .change, - .winutils, - .flow, - .lisp .title, - .clojure .built_in, - .nginx .title, - .tex .special - color: #2973b7 - .class .title - color: white - .symbol, - .symbol .string, - .value, - .regexp - color: $green - .title - color: #A6E22E - .tag .value, - .string, - .subst, - .haskell .type, - .preprocessor, - .ruby .class .parent, - .built_in, - .sql .aggregate, - .django .template_tag, - .django .variable, - .smalltalk .class, - .javadoc, - .django .filter .argument, - .smalltalk .localvars, - .smalltalk .array, - .attr_selector, - .pseudo, - .addition, - .stream, - .envvar, - .apache .tag, - .apache .cbracket, - .tex .command, - .prompt - color: $green - .comment, - .java .annotation, - .python .decorator, - .template_comment, - .pi, - .doctype, - .deletion, - .shebang, - .apache .sqbracket, - .tex .formula - color: #b3b3b3 - .coffeescript .javascript, - .javascript .xml, - .tex .formula, - .xml .javascript, - .xml .vbscript, - .xml .css, - .xml .cdata - opacity: 0.5 + white-space: pre + padding: 1.2em 1.4em + line-height: 1.5em + font-size: 1em + display: block + + .hljs + &-tag, + &-tag &-title, + &-change, + &-winutils, + &-flow, + &-tex &-special + color: #2973b7 + + &-symbol, + &-symbol &-string, + &-value, + &-regexp + &-string, + &-subst, + &-haskell &-type, + &-preprocessor, + &-ruby &-class &-parent, + &-built_in, + &-sql &-aggregate, + &-django &-template_tag, + &-django &-variable, + &-smalltalk &-class, + &-javadoc, + &-django &-filter &-argument, + &-smalltalk &-localvars, + &-smalltalk &-array, + &-attr_selector, + &-pseudo, + &-addition, + &-stream, + &-envvar, + &-apache &-tag, + &-apache &-cbracket, + &-tex &-command, + &-prompt + color: $green + + &-function &-keyword, + &-constant + color: #0092db + &-keyword, + &-attribute + color: #e96900 + &-number, + &-literal + color: #ae81ff + + &-class &-title + color: white + + &-title + color: #a6e22e + &-tag &-value, + + &-comment, + &-java &-annotation, + &-python &-decorator, + &-template_comment, + &-pi, + &-doctype, + &-deletion, + &-shebang, + &-apache &-sqbracket, +&-tex &-formula + color: #b3b3b3 + &-coffeescript &-javascript, + &-javascript &-xml, + &-tex &-formula, + &-xml &-javascript, + &-xml &-vbscript, + &-xml &-css, + &-xml &-cdata + opacity: 0.5 From a62ac26b2db7b70a1030323334c712265ab5a4a8 Mon Sep 17 00:00:00 2001 From: Phan An Date: Tue, 29 Jan 2019 21:27:20 +0100 Subject: [PATCH 2/5] Update hexo version --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 42cf1a17c9..030bfdfb41 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vuejs.org", "private": true, "hexo": { - "version": "3.7.1" + "version": "3.8.0" }, "scripts": { "start": "hexo server", @@ -29,4 +29,4 @@ "hoek": "^6.1.2", "request": "^2.85.0" } -} \ No newline at end of file +} From 3945e70135ffd12b8c57618429ff7ec4fcb607c7 Mon Sep 17 00:00:00 2001 From: Phan An Date: Tue, 29 Jan 2019 21:44:31 +0100 Subject: [PATCH 3/5] More tweaks --- themes/vue/source/css/_common.styl | 43 ------------------------------ themes/vue/source/css/_syntax.styl | 29 ++++++++++++++++++-- 2 files changed, 27 insertions(+), 45 deletions(-) diff --git a/themes/vue/source/css/_common.styl b/themes/vue/source/css/_common.styl index 3893468258..b4c8b1c52a 100644 --- a/themes/vue/source/css/_common.styl +++ b/themes/vue/source/css/_common.styl @@ -74,49 +74,6 @@ input.button color: $light border-color: #f6f6f6 -.highlight - overflow-x: auto - background-color: $codebg - padding: .4em 0 0 - line-height: 1.1em - border-radius: $radius - position: relative - table, tr, td - width: 100% - border-collapse: collapse - padding: 0 - margin: 0 - .gutter - width: 1.5em - .code - $code-line-height = 1.5em - pre - padding: 1.2em 1.4em - line-height: $code-line-height - margin: 0 - .line - min-height: $code-line-height - &.html, &.js, &.bash, &.css - .code:before - position: absolute - top: 0 - right: 0 - color: #ccc - text-align: right - font-size: .75em - padding: 5px 10px 0 - line-height: 15px - height: 15px - font-weight: 600 - &.html .code:before - content: "HTML" - &.js .code:before - content: "JS" - &.bash .code:before - content: "Shell" - &.css .code:before - content: "CSS" - #main position: relative z-index: 1 diff --git a/themes/vue/source/css/_syntax.styl b/themes/vue/source/css/_syntax.styl index 002c729140..ea9d33fe78 100644 --- a/themes/vue/source/css/_syntax.styl +++ b/themes/vue/source/css/_syntax.styl @@ -1,7 +1,9 @@ -.gutter pre - color: #999 +pre + border-radius: $radius + position: relative pre code + overflow-x: auto color: #525252 white-space: pre padding: 1.2em 1.4em @@ -83,3 +85,26 @@ pre code &-xml &-css, &-xml &-cdata opacity: 0.5 + + &.hljs + &.html, &.js, &.bash, &.css + &::before + font-family: $body-font + position: absolute + top: 0 + right: 0 + color: #ccc + text-align: right + font-size: .9em + padding: 5px 10px 0 + line-height: 15px + height: 15px + font-weight: 600 + &.html::before + content: "HTML" + &.js::before + content: "JS" + &.bash::before + content: "Shell" + &.css::before + content: "CSS" From 5604655552ac3236618a8bd2f74faa29b9551678 Mon Sep 17 00:00:00 2001 From: Phan An Date: Tue, 29 Jan 2019 21:48:09 +0100 Subject: [PATCH 4/5] Better formatting --- themes/vue/source/css/_syntax.styl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/themes/vue/source/css/_syntax.styl b/themes/vue/source/css/_syntax.styl index ea9d33fe78..0135008a95 100644 --- a/themes/vue/source/css/_syntax.styl +++ b/themes/vue/source/css/_syntax.styl @@ -52,9 +52,11 @@ pre code &-function &-keyword, &-constant color: #0092db + &-keyword, &-attribute color: #e96900 + &-number, &-literal color: #ae81ff @@ -75,8 +77,9 @@ pre code &-deletion, &-shebang, &-apache &-sqbracket, -&-tex &-formula + &-tex &-formula color: #b3b3b3 + &-coffeescript &-javascript, &-javascript &-xml, &-tex &-formula, @@ -100,11 +103,15 @@ pre code line-height: 15px height: 15px font-weight: 600 + &.html::before content: "HTML" + &.js::before content: "JS" + &.bash::before content: "Shell" + &.css::before content: "CSS" From bcd9a6bd04d619242107f7a5f21b1027bc59cd95 Mon Sep 17 00:00:00 2001 From: Phan An Date: Tue, 29 Jan 2019 22:15:12 +0100 Subject: [PATCH 5/5] Fix wrong section seperation --- themes/vue/source/css/_syntax.styl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/vue/source/css/_syntax.styl b/themes/vue/source/css/_syntax.styl index 0135008a95..dbe1017de2 100644 --- a/themes/vue/source/css/_syntax.styl +++ b/themes/vue/source/css/_syntax.styl @@ -66,8 +66,8 @@ pre code &-title color: #a6e22e - &-tag &-value, + &-tag &-value, &-comment, &-java &-annotation, &-python &-decorator,