diff --git a/_config.yml b/_config.yml index 7116730..a789a72 100644 --- a/_config.yml +++ b/_config.yml @@ -175,7 +175,6 @@ defaults: url: / sass: - sass_dir: /assets/css style: compressed compress_html: diff --git a/_includes/css-selector.html b/_includes/css-selector.html index b04be9c..77ee998 100644 --- a/_includes/css-selector.html +++ b/_includes/css-selector.html @@ -6,21 +6,9 @@ MIT Licensed --> + -{% if page.layout == 'category' or page.layout == 'tag' %} - {% assign style = 'category-tag' %} -{% else %} - {% assign style = page.layout %} -{% endif %} - -{% assign src = style | prepend: '/assets/css/' | append: '.css' | relative_url %} - - - - -{% if page.layout == 'post' %} - {% if site.toc and page.toc %} - - - {% endif %} +{% if site.toc and page.toc %} + {% endif %} diff --git a/assets/css/_addon/main.scss b/_sass/addon/commons.scss similarity index 98% rename from assets/css/_addon/main.scss rename to _sass/addon/commons.scss index 8f2a690..ca82eaa 100644 --- a/assets/css/_addon/main.scss +++ b/_sass/addon/commons.scss @@ -1,19 +1,8 @@ /* -* The main styles. -* v2.0 -* https://github.com/cotes2020/jekyll-theme-chirpy -* © 2018-2019 Cotes Chung -* MIT Licensed + The common styles */ - -@import "_addon/module"; -@import "_addon/variables"; -@import "_colors/light-typography"; -@import "_colors/dark-typography"; - @import url('https://fonts.googleapis.com/css2?family=Lato&family=Source+Sans+Pro:wght@400;600;900&display=swap'); - @mixin mode-toggle($dark-mode: false) { @if $dark-mode { @include dark-scheme; @@ -60,7 +49,7 @@ body { /*--- sidebar layout ---*/ -$tab-count: {{ site.tabs | size | plus: 1 }}; // plus 1 for home tab +$tab-count: 5 !default; $sidebar-display: "sidebar-display"; @@ -718,10 +707,10 @@ kbd { } a { - @at-root p>#{&} { + p > & { @extend %link-color; } - @at-root span>#{&} { + span > & { @extend %link-color; } .post-preview & { diff --git a/assets/css/_addon/module.scss b/_sass/addon/module.scss similarity index 100% rename from assets/css/_addon/module.scss rename to _sass/addon/module.scss diff --git a/assets/css/_addon/syntax.scss b/_sass/addon/syntax.scss similarity index 98% rename from assets/css/_addon/syntax.scss rename to _sass/addon/syntax.scss index c8a9aae..8107d34 100644 --- a/assets/css/_addon/syntax.scss +++ b/_sass/addon/syntax.scss @@ -6,8 +6,8 @@ * MIT Licensed */ -@import "_colors/light-syntax"; -@import "_colors/dark-syntax"; +@import "colors/light-syntax"; +@import "colors/dark-syntax"; html:not([mode]), html[mode=light] { diff --git a/assets/css/_addon/variables.scss b/_sass/addon/variables.scss similarity index 100% rename from assets/css/_addon/variables.scss rename to _sass/addon/variables.scss diff --git a/assets/css/_colors/dark-syntax.scss b/_sass/colors/dark-syntax.scss similarity index 96% rename from assets/css/_colors/dark-syntax.scss rename to _sass/colors/dark-syntax.scss index 9f4ba6e..6457e7c 100644 --- a/assets/css/_colors/dark-syntax.scss +++ b/_sass/colors/dark-syntax.scss @@ -1,10 +1,6 @@ -/*! -* The syntax dark mode styles. -* v2.0 -* https://github.com/cotes2020/jekyll-theme-chirpy -* © 2018-2019 Cotes Chung -* MIT Licensed -*/ +/* + * The syntax dark mode styles. + */ @mixin dark-syntax { /* ----- My styles ------ */ diff --git a/assets/css/_colors/dark-typography.scss b/_sass/colors/dark-typography.scss similarity index 96% rename from assets/css/_colors/dark-typography.scss rename to _sass/colors/dark-typography.scss index b41b061..7d6cc5b 100644 --- a/assets/css/_colors/dark-typography.scss +++ b/_sass/colors/dark-typography.scss @@ -1,10 +1,6 @@ -/*! -* The main dark mode styles -* v2.0 -* https://github.com/cotes2020/jekyll-theme-chirpy -* © 2018-2019 Cotes Chung -* MIT Licensed -*/ +/* + * The main dark mode styles + */ @mixin dark-scheme { /* framework */ diff --git a/assets/css/_colors/light-syntax.scss b/_sass/colors/light-syntax.scss similarity index 96% rename from assets/css/_colors/light-syntax.scss rename to _sass/colors/light-syntax.scss index 7fb0d27..9c2fb98 100644 --- a/assets/css/_colors/light-syntax.scss +++ b/_sass/colors/light-syntax.scss @@ -1,10 +1,6 @@ -/*! -* The syntax light mode code snippet colors. -* v2.1 -* https://github.com/cotes2020/jekyll-theme-chirpy -* © 2020 Cotes Chung -* MIT Licensed -*/ +/* + * The syntax light mode code snippet colors. + */ @mixin light-syntax { /* see: */ diff --git a/assets/css/_colors/light-typography.scss b/_sass/colors/light-typography.scss similarity index 93% rename from assets/css/_colors/light-typography.scss rename to _sass/colors/light-typography.scss index f1ec036..60018d6 100644 --- a/assets/css/_colors/light-typography.scss +++ b/_sass/colors/light-typography.scss @@ -1,10 +1,6 @@ -/*! -* The syntax light mode typography colors -* v2.1 -* https://github.com/cotes2020/jekyll-theme-chirpy -* © 2020 Cotes Chung -* MIT Licensed -*/ +/* + * The syntax light mode typography colors + */ @mixin light-scheme { /* Common */ diff --git a/_sass/jekyll-theme-chirpy.scss b/_sass/jekyll-theme-chirpy.scss new file mode 100644 index 0000000..e19c756 --- /dev/null +++ b/_sass/jekyll-theme-chirpy.scss @@ -0,0 +1,23 @@ +/* + * The main styles + * + * v2.7.2 + * https://github.com/cotes2020/jekyll-theme-chirpy + * © 2021 Cotes Chung + * MIT Licensed + */ + +@import "colors/light-typography"; +@import "colors/dark-typography"; + +@import "addon/module"; +@import "addon/variables"; +@import 'addon/syntax'; +@import "addon/commons"; + +@import "layout/home"; +@import "layout/post"; +@import "layout/tags"; +@import "layout/archives"; +@import "layout/categories"; +@import "layout/category-tag"; diff --git a/assets/css/archives.scss b/_sass/layout/archives.scss similarity index 94% rename from assets/css/archives.scss rename to _sass/layout/archives.scss index 0cad924..b3004a7 100644 --- a/assets/css/archives.scss +++ b/_sass/layout/archives.scss @@ -1,13 +1,6 @@ ---- -# Style for Archives -# v2.0 -# https://github.com/cotes2020/jekyll-theme-chirpy -# © 2019 Cotes Chung -# MIT License ---- - - -{% include_relative _addon/main.scss %} +/* + Style for Archives +*/ %date-timeline { content: ""; diff --git a/assets/css/categories.scss b/_sass/layout/categories.scss similarity index 86% rename from assets/css/categories.scss rename to _sass/layout/categories.scss index a72ebe9..4e123e9 100644 --- a/assets/css/categories.scss +++ b/_sass/layout/categories.scss @@ -1,13 +1,6 @@ ---- -# Style for Tab Categories -# v2.0 -# https://github.com/cotes2020/jekyll-theme-chirpy -# © 2019 Cotes Chung -# MIT License ---- - - -{% include_relative _addon/main.scss %} +/* + Style for Tab Categories +*/ %category-icon-color { color: gray; diff --git a/assets/css/category-tag.scss b/_sass/layout/category-tag.scss similarity index 85% rename from assets/css/category-tag.scss rename to _sass/layout/category-tag.scss index 87c2041..88064d6 100644 --- a/assets/css/category-tag.scss +++ b/_sass/layout/category-tag.scss @@ -1,13 +1,6 @@ ---- -# Style for page Category and Tag -# v2.0 -# https://github.com/cotes2020/jekyll-theme-chirpy -# © 2019 Cotes Chung -# MIT License ---- - - -{% include_relative _addon/main.scss %} +/* + Style for page Category and Tag +*/ #page-category, #page-tag { ul > li { diff --git a/assets/css/home.scss b/_sass/layout/home.scss similarity index 94% rename from assets/css/home.scss rename to _sass/layout/home.scss index 78f12a7..520f392 100644 --- a/assets/css/home.scss +++ b/_sass/layout/home.scss @@ -1,12 +1,6 @@ ---- -# Style for Homepage -# v2.0 -# https://github.com/cotes2020/jekyll-theme-chirpy -# © 2019 Cotes Chung -# MIT License ---- - -{% include_relative _addon/main.scss %} +/* + Style for Homepage +*/ #post-list { margin-top: 1rem; diff --git a/assets/css/post.scss b/_sass/layout/post.scss similarity index 94% rename from assets/css/post.scss rename to _sass/layout/post.scss index 85f8f9b..7f334a8 100644 --- a/assets/css/post.scss +++ b/_sass/layout/post.scss @@ -1,17 +1,9 @@ ---- -# Post-specific style -# v2.0 -# https://github.com/cotes2020/jekyll-theme-chirpy -# © 2019 Cotes Chung -# MIT License ---- +/* + Post-specific style +*/ - -{% include_relative _addon/main.scss %} -{% include_relative _addon/syntax.scss %} - -$prompt-older: "{{ site.data.label.post.button.previous }}"; -$prompt-newer: "{{ site.data.label.post.button.next }}"; +$prompt-older: 'older'!default; // "{{ site.data.label.post.button.previous }}"; +$prompt-newer: 'newer'!default; // "{{ site.data.label.post.button.next }}"; @mixin btn-sharing-color($light-color, $important: false) { @if $important { @@ -34,15 +26,17 @@ $prompt-newer: "{{ site.data.label.post.button.next }}"; padding-right: $pr; } -.post .post-meta { +#post-wrapper .post-meta { > div:nth-child(2) { > span:not(:first-child)::before { @include dot; } } + #pv::after { content: " views"; } + .readtime::after { content: " read"; } @@ -331,7 +325,7 @@ $prompt-newer: "{{ site.data.label.post.button.next }}"; } @media all and (min-width: 768px) { - .post { + #post-wrapper { .post-meta { >div:not(:first-child)::before { @include dot(0.5rem, 0.2rem); diff --git a/assets/css/tags.scss b/_sass/layout/tags.scss similarity index 65% rename from assets/css/tags.scss rename to _sass/layout/tags.scss index e8e4f8c..7c3bff4 100644 --- a/assets/css/tags.scss +++ b/_sass/layout/tags.scss @@ -1,13 +1,6 @@ ---- -# Styles for Tab Tags -# v2.0 -# https://github.com/cotes2020/jekyll-theme-chirpy -# © 2019 Cotes Chung -# MIT License ---- - - -{% include_relative _addon/main.scss %} +/* + Styles for Tab Tags +*/ .tag { border-radius: 0.7em; diff --git a/assets/css/lib/bootstrap-toc.min.css b/assets/css/lib/bootstrap-toc.min.css deleted file mode 100644 index 3c62107..0000000 --- a/assets/css/lib/bootstrap-toc.min.css +++ /dev/null @@ -1,4 +0,0 @@ -/*! - * Bootstrap Table of Contents v1.0.1 (http://afeld.github.io/bootstrap-toc/) - * Copyright 2015 Aidan Feldman - * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */nav[data-toggle=toc] .nav>li>a{display:block;padding:4px 20px;font-size:13px;font-weight:500;color:#767676}nav[data-toggle=toc] .nav>li>a:focus,nav[data-toggle=toc] .nav>li>a:hover{padding-left:19px;color:#563d7c;text-decoration:none;background-color:transparent;border-left:1px solid #563d7c}nav[data-toggle=toc] .nav-link.active,nav[data-toggle=toc] .nav-link.active:focus,nav[data-toggle=toc] .nav-link.active:hover{padding-left:18px;font-weight:700;color:#563d7c;background-color:transparent;border-left:2px solid #563d7c}nav[data-toggle=toc] .nav-link+ul{display:none;padding-bottom:10px}nav[data-toggle=toc] .nav .nav>li>a{padding-top:1px;padding-bottom:1px;padding-left:30px;font-size:12px;font-weight:400}nav[data-toggle=toc] .nav .nav>li>a:focus,nav[data-toggle=toc] .nav .nav>li>a:hover{padding-left:29px}nav[data-toggle=toc] .nav .nav>li>.active,nav[data-toggle=toc] .nav .nav>li>.active:focus,nav[data-toggle=toc] .nav .nav>li>.active:hover{padding-left:28px;font-weight:500}nav[data-toggle=toc] .nav-link.active+ul{display:block} \ No newline at end of file diff --git a/assets/css/page.scss b/assets/css/page.scss deleted file mode 100644 index 10ef9fa..0000000 --- a/assets/css/page.scss +++ /dev/null @@ -1,10 +0,0 @@ ---- -# The default style for layout Page -# v2.2 -# https://github.com/cotes2020/jekyll-theme-chirpy -# © 2020 Cotes Chung -# MIT License ---- - -{% include_relative _addon/main.scss %} -{% include_relative _addon/syntax.scss %} diff --git a/assets/css/style.scss b/assets/css/style.scss new file mode 100644 index 0000000..b80bf2d --- /dev/null +++ b/assets/css/style.scss @@ -0,0 +1,9 @@ +--- +--- + +$tab-count: {{ site.tabs | size | plus: 1 }}; // plus 1 for home tab + +$prompt-older: "{{ site.data.label.post.button.previous }}"; +$prompt-newer: "{{ site.data.label.post.button.next }}"; + +@import "jekyll-theme-chirpy";