diff --git a/_data/variables.yml b/_data/variables.yml index a0868277946..9ddfebc2d5d 100644 --- a/_data/variables.yml +++ b/_data/variables.yml @@ -7,4 +7,15 @@ default: rss: /feed.xml lang: zh toc: - selectors: 'h1,h2,h3' \ No newline at end of file + selectors: 'h1,h2,h3' + +sources: + jquery: 'https://cdn.bootcss.com/jquery/3.1.1/jquery.min.js' + leancloud_js_sdk: '//cdn1.lncld.net/static/js/3.4.1/av-min.js' + toc: 'https://cdn.bootcss.com/toc/0.3.2/toc.min.js' + chart: 'https://cdn.bootcss.com/Chart.js/2.7.1/Chart.bundle.min.js' + gitalk: + js: '//unpkg.com/gitalk/dist/gitalk.min.js' + css: '//unpkg.com/gitalk/dist/gitalk.css' + mathjax: 'https://cdn.bootcss.com/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML' + mermaid: 'https://cdn.bootcss.com/mermaid/7.1.2/mermaid.min.js' diff --git a/_includes/components/tags.html b/_includes/components/tags.html index 08a2b818c93..6992cc319df 100644 --- a/_includes/components/tags.html +++ b/_includes/components/tags.html @@ -15,10 +15,10 @@ {%- if gap_size < 1 -%} {%- assign gap_size = 1 -%} {%- endif -%} -
+
-
-{%- include snippets/page-title.html -%} - + \ No newline at end of file diff --git a/_layouts/base.html b/_layouts/base.html new file mode 100644 index 00000000000..9d3f490e5f1 --- /dev/null +++ b/_layouts/base.html @@ -0,0 +1,37 @@ + +{%- include snippets/get-lang.html -%} + + + {%- include common-head.html -%} + {%- include head-icons-rel.html -%} + {%- assign __path = '/assets/css/blog.css' -%} + {%- include snippets/prepend-baseurl.html -%} + + {%- include scripts/utils.html -%} + + +
+
+ {%- include components/header.html -%} +
{{ content }}
+
+
+ {%- include components/footer.html -%} + {%- if page.layout == "home" -%} + {%- include scripts/home.html -%} + {%- elsif page.layout == "page" -%} + {%- include scripts/page-post.html -%} + {%- elsif page.layout == "post" -%} + {%- include scripts/page-post.html -%} + {%- include scripts/post.html -%} + {%- elsif page.layout == "all" -%} + {%- include scripts/all.html -%} + {%- endif -%} + {%- include utils/mathjax.html -%} + {%- include utils/mermaid.html -%} + {%- include utils/chart.html -%} + {%- if jekyll.environment != "development" -%} + {%- include utils/google-analytics.html -%} + {%- endif -%} + + diff --git a/_layouts/blog-base.html b/_layouts/blog-base.html deleted file mode 100644 index 73bdda6a717..00000000000 --- a/_layouts/blog-base.html +++ /dev/null @@ -1,48 +0,0 @@ - -{%- include snippets/get-lang.html -%} - - - {%- include common-head.html -%} - {%- include head-icons-rel.html -%} - {%- assign __path = '/assets/css/blog.css' -%} - {%- include snippets/prepend-baseurl.html -%} - - - - -
{{ content }}
- {%- include components/footer.html -%} - - {%- include utils/mathjax.html -%} - {%- include utils/mermaid.html -%} - {%- include utils/chart.html -%} - {%- if jekyll.environment != "development" -%} - {%- include utils/google-analytics.html -%} - {%- endif -%} - - diff --git a/_layouts/blog-default.html b/_layouts/blog-default.html deleted file mode 100644 index 1ed91d80b0a..00000000000 --- a/_layouts/blog-default.html +++ /dev/null @@ -1,7 +0,0 @@ ---- -layout: blog-base ---- -
- {%- include components/header.html -%} -
{{ content }}
-
diff --git a/_layouts/error-404.html b/_layouts/error-404.html index 69fcb421380..d9c576f69d0 100644 --- a/_layouts/error-404.html +++ b/_layouts/error-404.html @@ -1,5 +1,5 @@ --- -layout: blog-default +layout: base title: 404 ---
diff --git a/_layouts/home.html b/_layouts/home.html index 611c8371294..0a1c3828412 100644 --- a/_layouts/home.html +++ b/_layouts/home.html @@ -1,5 +1,5 @@ --- -layout: blog-default +layout: base titles: en: Blog zh: 博客 @@ -92,9 +92,9 @@

{{ post.title }}

{%- else -%} {%- if _n0 and _n1 -%} {%- if page > 1 and page < _n0 -%} - {%- if page == 2 -%}
  • ...
  • {%- endif -%} + {%- if page == 2 -%}
  • {%- include icon/omit.svg -%}
  • {%- endif -%} {%- elsif page > _n1 and page < _length -%} - {%- if page == _length_mimus_one -%}
  • ...
  • {%- endif -%} + {%- if page == _length_mimus_one -%}
  • {%- include icon/omit.svg -%}
  • {%- endif -%} {%- else -%} {%- assign __path = site.paginate_path -%} {%- include snippets/prepend-baseurl.html -%} @@ -133,28 +133,3 @@

    {{ post.title }}

    {%- endif -%}
    -{%- if site.leancloud.app_id and site.leancloud.app_key and site.leancloud.app_class and jekyll.environment != "development" -%} - - -{%- endif -%} diff --git a/_layouts/page.html b/_layouts/page.html index 0d9bb6463de..486b5053a64 100644 --- a/_layouts/page.html +++ b/_layouts/page.html @@ -1,5 +1,5 @@ --- -layout: blog-default +layout: base ---
    diff --git a/_layouts/post.html b/_layouts/post.html index b48c2566fc2..00061b17540 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -1,13 +1,13 @@ --- -layout: blog-default +layout: base ---
    -
    +
    -
    +
    {%- include snippets/page-title.html -%} @@ -57,163 +57,4 @@

    {{ __return }}

    {%- endif -%}
    -
    -{%- assign _toc_selectors = site.toc.selectors | default: site.data.variables.default.toc.selectors -%} - - -{%- if page.key and site.leancloud.app_id and site.leancloud.app_key and site.leancloud.app_class and jekyll.environment != "development" -%} - - -{%- endif -%} \ No newline at end of file +
    \ No newline at end of file diff --git a/package.json b/package.json index 3a28e87fb14..fa3532cd068 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "default": "bundle exec jekyll serve -H 0.0.0.0 -t", "dev": "bundle exec jekyll serve -H 0.0.0.0 -t --config ./_config.dev.yml", "demo": "bundle exec jekyll serve -H 0.0.0.0 -t --config ./_config.demo.yml", + "production": "JEKYLL_ENV=production bundle exec jekyll serve -H 0.0.0.0 -t --config ./_config.demo.yml", "favicon": "gulp favicon", "icons": "gulp icons", "artwork": "gulp artwork",