From 0c3c5e1752af25cda91d005f5020af3599e02716 Mon Sep 17 00:00:00 2001 From: kitian616 Date: Sat, 23 Jun 2018 16:04:46 +0800 Subject: [PATCH] feat: update style, edit_on_github config --- 404.html | 2 - Gemfile | 10 +- README.md | 2 +- _config.yml | 2 + _data/locale.yml | 14 +- _data/variables.yml | 13 +- _includes/analytics-providers/google.html | 6 +- _includes/analytics.html | 8 +- .../custom.html | 0 _includes/article-footer/license.html | 14 ++ _includes/article-info.html | 35 ++--- _includes/comment.html | 9 -- _includes/comments-providers/custom.html | 0 .../disqus.html | 4 +- .../gitalk.html | 20 +-- _includes/comments.html | 10 ++ _includes/license.html | 26 ---- _includes/pageview-providers/custom/home.html | 0 _includes/pageview-providers/custom/post.html | 0 .../pageview-providers/leancloud/home.html | 6 +- .../pageview-providers/leancloud/post.html | 6 +- _includes/pageview.html | 12 +- _includes/snippets/page-title.html | 22 +++- _layouts/archive.html | 3 +- _layouts/article.html | 13 +- _layouts/home.html | 2 +- _layouts/landing.html | 4 +- _layouts/page.html | 47 ++++++- _sass/additional/_alert.scss | 14 +- _sass/additional/_photo-frame.scss | 2 +- _sass/common/_classes.scss | 1 + _sass/common/classes/_clearfix.scss | 8 ++ _sass/common/classes/_horizontal-rules.scss | 14 ++ _sass/common/components/_button.scss | 36 ++++++ _sass/components/_article.content.scss | 11 +- _sass/components/_article.info.scss | 18 +-- _sass/components/_license.scss | 23 ---- _sass/components/_main.scss | 6 - _sass/layout/_article.scss | 33 +++-- _sass/layout/_home.scss | 2 +- _sass/layout/_page.scss | 16 ++- about.md | 2 +- archive.html | 6 - docs/_config.dev.yml | 77 ++++++++--- docs/_config.yml | 76 ++++++++--- docs/_data/locale.yml | 14 +- docs/_data/variables.yml | 13 +- docs/about.html | 3 - docs/en/1.1-quick-start.md | 5 - docs/en/1.2-structure.md | 7 +- docs/en/2.1-configuration.md | 9 +- docs/en/2.2-navigation.md | 5 - docs/en/2.3-layouts.md | 7 +- docs/en/2.4-logo-and-favicon.md | 5 - docs/en/3.1-writing-posts.md | 5 - docs/en/3.2-markdown-enhancements.md | 5 - docs/en/3.3-additional-styles.md | 5 - docs/zh/1.1-quick-start.md | 6 - docs/zh/2.1-configuration.md | 6 - docs/zh/2.2-navigation.md | 6 - docs/zh/2.3-layouts.md | 6 - docs/zh/2.4-logo-and-favicon.md | 5 - docs/zh/3.1-writing-posts.md | 6 - docs/zh/3.2-markdown-enhancements.md | 6 - docs/zh/3.3-additional-styles.md | 6 - index.html | 6 - screenshot.png | Bin 298114 -> 312771 bytes test/_data/locale.yml | 122 ++++++++++-------- .../2015-01-01-article-with-long-toc.md | 1 - .../2015-01-03-article-with-lots-images.md | 1 - .../2015-01-06-punctuation-characters'.md | 1 - test/_posts/2015-02-02-very-long-title.md | 1 - test/_posts/2016-05-02-horizontal-rules.md | 1 - test/_posts/2016-05-04-footnote.md | 1 - test/_posts/2016-05-05-definition.md | 1 - test/_posts/2016-05-08-blockquotes.md | 1 - test/_posts/2016-06-06-lists.md | 1 - test/_posts/2016-06-10-tables.md | 1 - test/_posts/2016-06-16-code-blocks.md | 1 - test/_posts/2016-07-07-images.md | 1 - test/_posts/2016-09-01-links.md | 1 - test/_posts/2016-09-09-emphasis.md | 1 - test/_posts/2016-09-19-headers.md | 1 - test/_posts/2016-10-10-paragraphs.md | 1 - test/_posts/2017-04-03-english.md | 1 - test/_posts/2017-04-12-traditional-chinese.md | 1 - test/_posts/2017-04-13-simplified-chinese.md | 1 - test/_posts/2017-04-19-modify-date.md | 1 - test/_posts/2017-05-05-chart.md | 1 - test/_posts/2017-06-06-mermaid.md | 1 - test/_posts/2017-07-07-mathjax.md | 1 - test/_posts/2017-08-08-additional-styles.md | 1 - 92 files changed, 477 insertions(+), 440 deletions(-) rename _includes/{comment-providers => article-footer}/custom.html (100%) create mode 100644 _includes/article-footer/license.html delete mode 100644 _includes/comment.html create mode 100644 _includes/comments-providers/custom.html rename _includes/{comment-providers => comments-providers}/disqus.html (87%) rename _includes/{comment-providers => comments-providers}/gitalk.html (59%) create mode 100644 _includes/comments.html delete mode 100644 _includes/license.html create mode 100644 _includes/pageview-providers/custom/home.html create mode 100644 _includes/pageview-providers/custom/post.html create mode 100644 _sass/common/classes/_horizontal-rules.scss diff --git a/404.html b/404.html index 45b670357df..c4e870fdc7d 100644 --- a/404.html +++ b/404.html @@ -1,5 +1,3 @@ --- layout: 404 -title: 404 -show_title: false --- diff --git a/Gemfile b/Gemfile index 8a12e538054..c8ae8010451 100644 --- a/Gemfile +++ b/Gemfile @@ -1,8 +1,6 @@ -source 'https://rubygems.org/' +source "https://rubygems.org" -gemspec +gem "github-pages", group: :jekyll_plugins -# For dev under windows, I know that yikes.... - -# gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw] -# gem 'wdm', '>= 0.1.0' if Gem.win_platform? \ No newline at end of file +gem "tzinfo-data" +gem "wdm", "~> 0.1.0" if Gem.win_platform? \ No newline at end of file diff --git a/README.md b/README.md index 93ccd550632..f15dbab7bc9 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ TeXt is a Jekyll theme for personal site, blog, project, documentation and so on - Search - Page views ([LeanCloud](https://leancloud.cn/)) - Emoji ([Jemoji](https://github.com/jekyll/jemoji)) -- Comment ([Disqus](https://disqus.com/)) +- Comments ([Disqus](https://disqus.com/)) - Google Analytics - Contact information (Email, Facebook, Twitter, Linkedin, Weibo, Zhihu, etc) - Semantic HTML diff --git a/_config.yml b/_config.yml index 6d923724790..6767acebe59 100644 --- a/_config.yml +++ b/_config.yml @@ -152,9 +152,11 @@ defaults: path: "" type: posts values: + layout: article license: true aside: toc: true + show_edit_on_github: true pageview: true diff --git a/_data/locale.yml b/_data/locale.yml index 81353bc4247..0e38bb33548 100644 --- a/_data/locale.yml +++ b/_data/locale.yml @@ -69,17 +69,11 @@ LICENSE_ANNOUNCE: zh-Hans: "本文遵守 [LICENSE] 许可协议。" zh-Hant: "本文遵守 [LICENSE] 許可協議。" -LICENSE_INTRO: - en: - zh: "欢迎转载,转载需注明出处,且禁止用于商业目的。" - zh-Hans: "欢迎转载,转载需注明出处,且禁止用于商业目的。" - zh-Hant: "歡迎轉載,轉載需註明出處,且禁止用於商業目的。" - POST_ON_GITHUB: - en: "View this POST on Github." - zh: "在 Github 上查阅此文。" - zh-Hans: "在 Github 上查阅此文。" - zh-Hant: "在 Github 上查閱此文。" + en: "Edit on Github" + zh: "在 Github 上修改" + zh-Hans: "在 Github 上修改" + zh-Hant: "在 Github 上修改" FOLLOW_ME: en: "Follow me on [NAME]." diff --git a/_data/variables.yml b/_data/variables.yml index ed434c0935e..ca196176791 100644 --- a/_data/variables.yml +++ b/_data/variables.yml @@ -12,12 +12,15 @@ default: chart: false toc: selectors: 'h1,h2,h3' - show_title: true - show_header: true - full_width: false - pageview: false - excerpt_type: text sources: bootcdn + excerpt_type: text + + page: + show_header: true + show_title: true + show_edit_on_github: false + full_width: false + pageview: false sources: bootcdn: diff --git a/_includes/analytics-providers/google.html b/_includes/analytics-providers/google.html index 7d7fad57db9..8c7549a230f 100644 --- a/_includes/analytics-providers/google.html +++ b/_includes/analytics-providers/google.html @@ -1,4 +1,4 @@ -{%- if site.ga_tracking_id -%} +{%- if site.analytics.google.tracking_id -%} diff --git a/_includes/analytics.html b/_includes/analytics.html index cdeb101a593..070af6048c6 100644 --- a/_includes/analytics.html +++ b/_includes/analytics.html @@ -1,3 +1,7 @@ -{%- if jekyll.environment != "development" -%} - {%- include analytics-providers/google.html -%} +{%- if jekyll.environment != 'development' -%} + {%- if site.analytics.provider == 'google' -%} + {%- include analytics-providers/google.html -%} + {%- elsif site.analytics.provider == 'custom' -%} + {%- include analytics-providers/custom.html -%} + {%- endif -%} {%- endif -%} \ No newline at end of file diff --git a/_includes/comment-providers/custom.html b/_includes/article-footer/custom.html similarity index 100% rename from _includes/comment-providers/custom.html rename to _includes/article-footer/custom.html diff --git a/_includes/article-footer/license.html b/_includes/article-footer/license.html new file mode 100644 index 00000000000..708bb469330 --- /dev/null +++ b/_includes/article-footer/license.html @@ -0,0 +1,14 @@ +
+ {%- assign locale = site.data.locale -%} + {%- assign __locale = locale.LICENSE_ANNOUNCE -%} + {%- include snippets/locale-to-string.html -%} + {%- assign _license_announce = __return -%} + {%- assign __path = '/assets/images/license-cc4.png' -%} + {%- include snippets/prepend-baseurl.html -%} + {%- assign _license_img_src = __return -%} +

{{ _license_announce | replace: "[LICENSE]", 'CC-BY-NC-4.0' }} + + Creative Commons License + +

+
\ No newline at end of file diff --git a/_includes/article-info.html b/_includes/article-info.html index 660f7834034..9d11f593ac8 100644 --- a/_includes/article-info.html +++ b/_includes/article-info.html @@ -9,7 +9,7 @@ {%- include snippets/assign.html -%} {%- assign _pageview = __return -%} -
+ diff --git a/_includes/comment.html b/_includes/comment.html deleted file mode 100644 index a5757f9bd8e..00000000000 --- a/_includes/comment.html +++ /dev/null @@ -1,9 +0,0 @@ -{%- if jekyll.environment != "development" -%} - - {%- if site.disqus.shortname -%} - {%- include comment-providers/disqus.html -%} - {%- elsif site.gitalk.clientID and site.gitalk.clientSecret and site.gitalk.repository and site.gitalk.owner and site.gitalk.admin -%} - {%- include comment-providers/gitalk.html -%} - {%- endif -%} - -{%- endif -%} \ No newline at end of file diff --git a/_includes/comments-providers/custom.html b/_includes/comments-providers/custom.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/_includes/comment-providers/disqus.html b/_includes/comments-providers/disqus.html similarity index 87% rename from _includes/comment-providers/disqus.html rename to _includes/comments-providers/disqus.html index c79653090fc..c06137c01f6 100644 --- a/_includes/comment-providers/disqus.html +++ b/_includes/comments-providers/disqus.html @@ -1,5 +1,5 @@ {%- if page.key and - site.disqus.shortname -%} + site.comments.disqus.shortname -%}