From dcbc7547fcf63c62beedb42cd302d9f4d12ec906 Mon Sep 17 00:00:00 2001 From: Dillon Date: Mon, 19 Aug 2019 13:26:39 +0800 Subject: [PATCH] feat: new style update --- archetypes/default.md | 5 ++- assets/css/_core/_base.scss | 8 ++++ assets/css/_core/_media.scss | 7 ---- assets/css/_page/_post.scss | 64 +++++++++++++++++++++++++++++-- assets/css/_page/_posts.scss | 1 + assets/css/_variables.scss | 3 ++ i18n/en.toml | 4 +- i18n/zh.toml | 7 +++- layouts/_default/single.md | 1 + layouts/partials/post/footer.html | 28 +++++++++++--- layouts/posts/single.html | 3 ++ 11 files changed, 109 insertions(+), 22 deletions(-) create mode 100644 layouts/_default/single.md diff --git a/archetypes/default.md b/archetypes/default.md index c6b1abf5..4ee62f42 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -6,12 +6,13 @@ draft: true description: "" show_in_homepage: true show_description: false +license: '' tags: [] categories: [] -featured_image: "" -featured_image_preview: "" +featured_image: '' +featured_image_preview: '' comment: true toc: false diff --git a/assets/css/_core/_base.scss b/assets/css/_core/_base.scss index adae81aa..670cbe5f 100644 --- a/assets/css/_core/_base.scss +++ b/assets/css/_core/_base.scss @@ -73,3 +73,11 @@ a { } } } + +.navbar { + background-color: $navbar-background-color; + + .dark-theme & { + background-color: $navbar-background-color-dark; + } +} diff --git a/assets/css/_core/_media.scss b/assets/css/_core/_media.scss index 8fb14392..20eeaee7 100644 --- a/assets/css/_core/_media.scss +++ b/assets/css/_core/_media.scss @@ -19,7 +19,6 @@ margin: 0; height: 4.5em; line-height: 4.5em; - background: $global-background-color; .navbar-header { display: flex; @@ -90,7 +89,6 @@ .menu { text-align: center; - background: $global-background-color; border-top: 2px solid $global-font-color; display: none; box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1), 0px 4px 8px rgba(0, 0, 0, 0.1); @@ -105,14 +103,9 @@ } .dark-theme & { - background: $global-background-color-dark; border-top: 2px solid $global-font-color-dark; } } - - .dark-theme & { - background: $global-background-color-dark !important; - } } } diff --git a/assets/css/_page/_post.scss b/assets/css/_page/_post.scss index c278c2b8..f7ec4c79 100644 --- a/assets/css/_page/_post.scss +++ b/assets/css/_page/_post.scss @@ -144,6 +144,22 @@ padding-left: 2em; } + ruby { + background: $code-background; + + rt { + color: $global-font-secondary-color; + } + + .dark-theme & { + background: $code-background-dark; + + rt { + color: $global-font-secondary-color-dark; + } + } + } + .table-wrapper { overflow-x: auto; @@ -362,20 +378,60 @@ p { font-size: 1em; margin: .5em 0 .5em 0; + text-align: justify; } .post-footer { + margin-top: 3rem; + .post-info { - margin-top: 3rem; border-bottom: 1px solid $global-border-color; padding: 1rem 0 0.3rem; - display: flex; - justify-content: space-between; .dark-theme & { - border-top: 1px solid $global-border-color-dark; border-bottom: 1px solid $global-border-color-dark; } + + .post-info-line { + display: flex; + justify-content: space-between; + + .post-info-mod { + font-size: 0.8em; + color: $global-font-secondary-color; + + .dark-theme & { + color: $global-font-secondary-color-dark; + } + } + + .post-info-license { + font-size: 0.8em; + color: $global-font-secondary-color; + + .dark-theme & { + color: $global-font-secondary-color-dark; + } + } + + .post-info-md + a { + font-size: 0.8em; + color: $post-link-color; + + .dark-theme & { + color: $post-link-color-dark; + } + + &:hover { + color: $post-link-hover-color; + + .dark-theme & { + color: $post-link-hover-color-dark; + } + } + } + } } .post-tags { diff --git a/assets/css/_page/_posts.scss b/assets/css/_page/_posts.scss index 77f1cfce..a5a60085 100644 --- a/assets/css/_page/_posts.scss +++ b/assets/css/_page/_posts.scss @@ -84,6 +84,7 @@ } .post-footer { + margin-top: 0; display: flex; justify-content: space-between; align-items: center; diff --git a/assets/css/_variables.scss b/assets/css/_variables.scss index c0fbc718..5e395769 100644 --- a/assets/css/_variables.scss +++ b/assets/css/_variables.scss @@ -7,6 +7,9 @@ $global-background-color: #fff !default; $global-background-color-dark: #292a2d !default; +$navbar-background-color: #FAFAFA !default; +$navbar-background-color-dark: #252627 !default; + // Text color of the body. $global-font-color: #161209 !default; $global-font-color-dark: #a9a9b3 !default; diff --git a/i18n/en.toml b/i18n/en.toml index 3c4db8fc..25da8baf 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -59,7 +59,7 @@ other = "Author" other = "This article is updated with %s" [license] -other = "License" +other = "Published under the %s license" [back] other = "Back" @@ -68,7 +68,7 @@ other = "Back" other = "Home" [readmore] -other = "Read More......" +other = "Read More" # === posts/single.html === # === 404.html === diff --git a/i18n/zh.toml b/i18n/zh.toml index d3c9b7f6..0a9eb3f2 100644 --- a/i18n/zh.toml +++ b/i18n/zh.toml @@ -59,7 +59,10 @@ other = "作者" other = "本文于 %s 更新" [license] -other = "许可协议" +other = "采用 %s 协议发布" + +[seeMarkDown] +other = "阅读原始文档" [back] other = "返回" @@ -68,7 +71,7 @@ other = "返回" other = "主页" [readmore] -other = "阅读全文......" +other = "阅读全文" # === posts/single.html === # === 404.html === diff --git a/layouts/_default/single.md b/layouts/_default/single.md new file mode 100644 index 00000000..57705e2c --- /dev/null +++ b/layouts/_default/single.md @@ -0,0 +1 @@ +{{ .RawContent }} \ No newline at end of file diff --git a/layouts/partials/post/footer.html b/layouts/partials/post/footer.html index 981fa6f5..0900b2ef 100644 --- a/layouts/partials/post/footer.html +++ b/layouts/partials/post/footer.html @@ -1,11 +1,29 @@ {{ $modify_date := .Lastmod.Format (.Site.Params.dateFormatToUse | default "2006-01-02") -}}