jekyll-text-theme 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +161 -0
  4. data/_includes/blog/article-data.html +43 -0
  5. data/_includes/blog/footer.html +14 -0
  6. data/_includes/blog/header.html +22 -0
  7. data/_includes/blog/license.html +17 -0
  8. data/_includes/blog/tags.html +49 -0
  9. data/_includes/common-head.html +7 -0
  10. data/_includes/head-icons-rel.html +25 -0
  11. data/_includes/icon/mail.svg +6 -0
  12. data/_includes/icon/menu.svg +3 -0
  13. data/_includes/icon/next.svg +3 -0
  14. data/_includes/icon/previous.svg +3 -0
  15. data/_includes/icon/social/behance.svg +3 -0
  16. data/_includes/icon/social/douban.svg +5 -0
  17. data/_includes/icon/social/facebook.svg +3 -0
  18. data/_includes/icon/social/flicker.svg +5 -0
  19. data/_includes/icon/social/github.svg +3 -0
  20. data/_includes/icon/social/googleplus.svg +3 -0
  21. data/_includes/icon/social/linkedin.svg +3 -0
  22. data/_includes/icon/social/pinterest.svg +3 -0
  23. data/_includes/icon/social/qq.svg +3 -0
  24. data/_includes/icon/social/twitter.svg +3 -0
  25. data/_includes/icon/social/weibo.svg +6 -0
  26. data/_includes/icon/social/weixin.svg +3 -0
  27. data/_includes/icon/social/zhihu.svg +3 -0
  28. data/_includes/info/follow-me.html +74 -0
  29. data/_includes/logo/logo.svg +8 -0
  30. data/_includes/snippets/page-url.html +1 -0
  31. data/_includes/snippets/rss-url.html +1 -0
  32. data/_includes/utils/comment-disqus.html +22 -0
  33. data/_includes/utils/google-analytics.html +13 -0
  34. data/_includes/utils/mathjax.html +5 -0
  35. data/_layouts/all.html +114 -0
  36. data/_layouts/blog-base.html +34 -0
  37. data/_layouts/blog-default.html +9 -0
  38. data/_layouts/error-404.html +9 -0
  39. data/_layouts/home-base.html +15 -0
  40. data/_layouts/home.html +92 -0
  41. data/_layouts/none.html +1 -0
  42. data/_layouts/page.html +15 -0
  43. data/_layouts/post.html +206 -0
  44. data/_sass/base/_animate.scss +19 -0
  45. data/_sass/base/_base.scss +55 -0
  46. data/_sass/base/_image&icon.scss +20 -0
  47. data/_sass/base/_links.scss +84 -0
  48. data/_sass/base/_text.scss +50 -0
  49. data/_sass/blog/_layout.base.scss +3 -0
  50. data/_sass/blog/_layout.default.scss +20 -0
  51. data/_sass/blog/_layout.page.scss +1 -0
  52. data/_sass/blog/_layout.post.scss +66 -0
  53. data/_sass/blog/_page.all.scss +35 -0
  54. data/_sass/blog/_page.error-404.scss +7 -0
  55. data/_sass/blog/_page.index.scss +45 -0
  56. data/_sass/colors/_colors.dark.scss +38 -0
  57. data/_sass/colors/_colors.default.scss +39 -0
  58. data/_sass/colors/_colors.forest.scss +39 -0
  59. data/_sass/colors/_colors.ocean.scss +39 -0
  60. data/_sass/components/_article.content.scss +140 -0
  61. data/_sass/components/_article.data.scss +35 -0
  62. data/_sass/components/_follow-me.scss +70 -0
  63. data/_sass/components/_footer.scss +36 -0
  64. data/_sass/components/_header.scss +44 -0
  65. data/_sass/components/_license.scss +27 -0
  66. data/_sass/components/_pagination.scss +7 -0
  67. data/_sass/components/_tags.scss +33 -0
  68. data/_sass/components/_toc.scss +61 -0
  69. data/_sass/components/_wrapper.scss +23 -0
  70. data/_sass/mixins/_flex.scss +394 -0
  71. data/_sass/mixins/_link.scss +60 -0
  72. data/_sass/mixins/_media.scss +12 -0
  73. data/_sass/mixins/_prefix.scss +14 -0
  74. data/_sass/settings/_base.scss +12 -0
  75. data/_sass/settings/_colors.scss +4 -0
  76. data/_sass/settings/_font.scss +32 -0
  77. data/_sass/settings/_highlighting.scss +72 -0
  78. data/assets/css/blog.scss +46 -0
  79. data/assets/images/license-cc4.png +0 -0
  80. data/assets/images/logo/icon-120x120.png +0 -0
  81. data/assets/images/logo/icon-128x128.png +0 -0
  82. data/assets/images/logo/icon-150x150.png +0 -0
  83. data/assets/images/logo/icon-152x152.png +0 -0
  84. data/assets/images/logo/icon-167x167.png +0 -0
  85. data/assets/images/logo/icon-16x16.png +0 -0
  86. data/assets/images/logo/icon-180x180.png +0 -0
  87. data/assets/images/logo/icon-192x192.png +0 -0
  88. data/assets/images/logo/icon-310x150.png +0 -0
  89. data/assets/images/logo/icon-310x310.png +0 -0
  90. data/assets/images/logo/icon-48x48.png +0 -0
  91. data/assets/images/logo/icon-70x70.png +0 -0
  92. data/assets/images/logo/logo.svg +8 -0
  93. data/assets/images/octocat.jpg +0 -0
  94. metadata +234 -0
@@ -0,0 +1,3 @@
1
+ <svg fill="#000000" width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M116.434944 581.71392c-33.540096 78.963712-38.984704 154.297344-12.058624 168.370176 18.572288 9.696256 47.685632-12.382208 74.93632-52.909056 10.790912 44.156928 37.492736 84.13696 75.63264 116.209664-40.003584 14.768128-66.13504 38.8864-66.13504 66.23232 0 44.9536 70.709248 81.301504 157.9776 81.301504 78.715904 0 143.906816-29.538304 155.93984-68.371456 3.231744-0.049152 15.663104-0.049152 18.79552 0 12.0832 38.784 77.324288 68.371456 155.988992 68.371456 87.267328 0 157.9776-36.39808 157.9776-81.301504 0-27.296768-26.104832-51.464192-66.13504-66.23232 38.088704-32.12288 64.888832-72.052736 75.630592-116.209664 27.250688 40.526848 56.290304 62.605312 74.887168 52.909056 26.949632-14.072832 21.630976-89.455616-12.032-168.370176-26.354688-62.058496-62.109696-107.754496-89.45664-117.848064 0.398336-3.929088 0.595968-7.957504 0.595968-11.93472 0-23.967744-6.66112-46.145536-18.049024-64.195584 0.198656-1.39264 0.198656-2.834432 0.198656-4.227072 0-11.037696-2.635776-21.38112-7.113728-30.331904-6.908928-161.308672-111.930368-289.401856-281.86624-289.401856-170.036224 0-275.105792 128.093184-281.94304 289.401856-4.525056 9.00096-7.135232 19.34336-7.135232 30.331904 0 1.39264 0.099328 2.835456 0.149504 4.227072-11.287552 18.050048-17.95072 40.177664-17.95072 64.195584 0 3.97824 0.149504 7.955456 0.497664 11.93472C178.61632 473.959424 142.739456 519.706624 116.434944 581.71392z"></path>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg fill="#000000" width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M1024.032 194.432c-37.664 16.704-78.176 28-120.672 33.088 43.36-26.016 76.672-67.168 92.384-116.224-40.608 24.064-85.568 41.568-133.408 50.976-38.336-40.832-92.928-66.336-153.344-66.336-116.032 0-210.08 94.048-210.08 210.08 0 16.48 1.856 32.512 5.44 47.872-174.592-8.768-329.408-92.416-433.024-219.52-18.08 31.04-28.448 67.104-28.448 105.632 0 72.896 37.088 137.184 93.472 174.88-34.432-1.088-66.816-10.528-95.168-26.272-0.032 0.864-0.032 1.76-0.032 2.656 0 101.792 72.416 186.688 168.512 205.984-17.632 4.8-36.192 7.36-55.36 7.36-13.536 0-26.688-1.312-39.52-3.776 26.72 83.456 104.32 144.192 196.256 145.888-71.904 56.352-162.496 89.92-260.928 89.92-16.96 0-33.664-0.992-50.112-2.944 92.96 59.616 203.392 94.4 322.048 94.4 386.432 0 597.728-320.128 597.728-597.76 0-9.12-0.192-18.176-0.608-27.168 41.056-29.632 76.672-66.624 104.832-108.736z"></path>
3
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg fill="#000000" width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M769.226164 496.610234c-14.420098-4.330228-24.309277-7.266877-16.746482-26.214823 16.350218-41.133578 18.046881-76.626289 0.307181-101.939024-33.242099-47.500415-124.194284-44.928286-228.44638-1.280945 0-0.056317-32.73525 14.323848-24.371737-11.64523 16.042013-51.54906 13.626547-94.739726-11.332929-119.662341-56.566349-56.601163-206.976479 2.134908-335.954595 131.078209-96.594075 96.61353-152.681222 198.989775-152.681222 287.52035 0 169.337597 217.152361 272.292366 429.593589 272.292366 278.498445 0 463.752111-161.808592 463.752111-290.273715C893.345701 558.867622 827.968378 514.820945 769.226164 496.610234zM430.163922 866.063936c-169.51781 16.728051-315.851649-59.899262-326.864086-171.202185-11.010389-111.275277 117.530505-215.061482 287.031932-231.823323 169.537265-16.761841 315.876224 59.866496 326.86511 171.119247C728.190884 745.495411 599.705282 849.291856 430.163922 866.063936z" />
3
+ <path d="M954.16753 186.714824c-67.256246-74.565105-166.457264-102.990607-258.020739-83.522502l-0.037886 0c-21.188318 4.535015-34.695065 25.37929-30.159026 46.527675 4.516584 21.166816 25.352668 34.691993 46.54201 30.174385 65.139769-13.832358 135.634727 6.400627 183.442323 59.368863 47.765615 52.96414 60.740938 125.206957 40.282686 188.537431l0.011263 0.012287c-6.666851 20.629249 4.617954 42.698153 25.271777 49.366027 20.570885 6.662755 42.687913-4.607714 49.362955-25.188838 0-0.037886 0-0.116729 0.011263-0.150519C1039.577146 362.756133 1021.443231 261.206205 954.16753 186.714824" />
4
+ <path d="M850.886125 279.919669c-32.732179-36.315956-81.068126-50.108381-125.685136-40.621609-18.234261 3.885839-29.856965 21.833398-25.946551 40.085067 3.89915 18.173849 21.833398 29.851845 40.024654 25.893307l0 0.037886c21.809848-4.610786 45.459709 2.113405 61.461789 19.83365 16.018463 17.757107 20.323092 41.949655 13.45043 63.178931l0.035838 0c-5.715614 17.717174 3.983113 36.770584 21.717694 42.511796 17.7397 5.677728 36.76956-3.992328 42.493365-21.756603C892.458972 365.691759 883.686907 316.228458 850.886125 279.919669" />
5
+ <path d="M447.103928 548.691741c-80.666743-20.985579-171.84317 19.215193-206.880229 90.291746-35.685212 72.492657-1.180599 152.963828 80.321676 179.268757 84.41947 27.224424 183.926645-14.492797 218.521364-92.744074C573.187374 649.021137 530.586496 570.268131 447.103928 548.691741zM385.506979 733.819463c-16.398343 26.160554-51.51015 37.623523-77.954335 25.54824-26.066352-11.868448-33.760211-42.248645-17.360844-67.757975 16.197652-25.400793 50.129884-36.716316 76.378497-25.711046C393.129162 677.216253 401.60838 707.401901 385.506979 733.819463zM439.522702 664.493841c-5.929616 10.131852-19.03498 15.010909-29.304039 10.785123-10.096014-4.15411-13.261002-15.495231-7.522862-25.454038 5.906066-9.908634 18.500485-14.747758 28.572948-10.750309C441.502995 642.817105 445.180975 654.283146 439.522702 664.493841z" />
6
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg fill="#000000" width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M684.111464 364.088889c10.47478 0 20.949559 0.722399 31.424339 1.805996-28.173545-131.476543-168.680071-229.000353-329.052557-229.000353-179.15485 0-326.162963 122.085362-326.162963 277.401058 0 89.577425 48.761905 163.262081 130.392945 220.33157l-32.507937 98.246208L272.344268 675.442681c40.81552 7.946384 73.684656 16.253968 114.138977 16.253968 10.11358 0 20.22716-0.361199 30.340741-1.444797-6.501587-21.671958-10.11358-44.788713-10.11358-68.266667C406.710406 479.672663 529.156966 364.088889 684.111464 364.088889zM508.568607 275.595062c24.561552 0 40.81552 16.253968 40.81552 40.81552 0 24.561552-16.253968 40.81552-40.81552 40.81552-24.561552 0-49.123104-16.253968-49.123104-40.81552C459.806702 291.84903 484.368254 275.595062 508.568607 275.595062zM280.290653 357.226102c-24.561552 0-49.123104-16.253968-49.123104-40.81552 0-24.561552 24.561552-40.81552 49.123104-40.81552 24.561552 0 40.81552 16.253968 40.81552 40.81552C321.106173 340.610935 304.852205 357.226102 280.290653 357.226102z" p-id="792"></path><path d="M981.739683 618.373192c0-130.392945-130.392945-236.585538-277.039859-236.585538-155.315697 0-277.401058 106.192593-277.401058 236.585538 0 130.754145 122.085362 236.585538 277.401058 236.585538 32.507937 0 65.377072-8.307584 97.885009-16.253968l89.577425 49.123104-24.561552-81.631041C932.977778 757.073721 981.739683 691.696649 981.739683 618.373192zM614.761199 577.557672c-16.253968 0-32.507937-16.253968-32.507937-32.507937 0-16.253968 16.253968-32.507937 32.507937-32.507937 24.561552 0 40.81552 16.253968 40.81552 32.507937C655.57672 561.303704 639.322751 577.557672 614.761199 577.557672zM794.277249 577.557672c-16.253968 0-32.507937-16.253968-32.507937-32.507937 0-16.253968 16.253968-32.507937 32.507937-32.507937 24.561552 0 40.81552 16.253968 40.81552 32.507937C835.092769 561.303704 818.477601 577.557672 794.277249 577.557672z"></path>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg fill="#000000" width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M351.791182 562.469462l192.945407 0c0-45.367257-21.3871-71.939449-21.3871-71.939449L355.897709 490.530013c3.977591-82.182744 7.541767-187.659007 8.816806-226.835262l159.282726 0c0 0-0.86367-67.402109-18.578124-67.402109s-279.979646 0-279.979646 0 16.850783-88.141456 39.318494-127.053698c0 0-83.60514-4.510734-112.121614 106.962104S81.344656 355.077018 76.80834 367.390461c-4.536316 12.313443 24.62791 5.832845 36.941354 0 12.313443-5.832845 68.050885-25.924439 84.252893-103.69571l86.570681 0c1.165546 49.28652 4.596691 200.335724 3.515057 226.835262L109.86113 490.530013c-25.275663 18.147312-33.701566 71.939449-33.701566 71.939449L279.868105 562.469462c-8.497535 56.255235-23.417339 128.763642-44.275389 167.210279-33.05279 60.921511-50.55235 116.65793-169.802314 212.576513 0 0-19.442818 14.257725 40.829917 9.073656 60.273758-5.185093 117.305683-20.739347 156.840094-99.807147 20.553105-41.107233 41.805128-93.250824 58.386782-146.138358l-0.055259 0.185218 167.855986 193.263655c0 0 22.035876-51.847855 5.832845-108.880803L371.045711 650.610918l-42.1244 31.157627-0.045025 0.151449c11.69946-41.020252 20.11206-81.5749 22.726607-116.858498C351.665315 564.212152 351.72876 563.345412 351.791182 562.469462z" p-id="907"></path><path d="M584.918753 182.033893l0 668.840094 70.318532 0 28.807093 80.512708 121.875768-80.512708 153.600307 0L959.520453 182.033893 584.918753 182.033893zM887.150192 778.934538l-79.837326 0-99.578949 65.782216-23.537066-65.782216-24.855084 0L659.341766 256.673847l227.807403 0L887.149169 778.934538z"></path>
3
+ </svg>
@@ -0,0 +1,74 @@
1
+ <div class="follow-me">
2
+ <ul class="inline-list" itemscope itemtype="http://schema.org/Person">
3
+ <meta itemprop="name" content="{{ site.author.name }}">
4
+ <link itemprop="url" href="{{ '/' | prepend: site.url }}">
5
+ {% if site.author.weibo %}
6
+ <li title="Follow me on Weibo.">
7
+ <div class="round-button weibo">
8
+ <a itemprop="sameAs" href="https://weibo.com/{{ site.author.weibo }}" target="_blank">
9
+ <div class="icon">{% include icon/social/weibo.svg %}</div>
10
+ </a>
11
+ </div>
12
+ </li>
13
+ {% endif %}
14
+ {% if site.author.facebook %}
15
+ <li title="Follow me on Facebook.">
16
+ <div class="round-button facebook">
17
+ <a itemprop="sameAs" href="https://www.facebook.com/{{ site.author.facebook }}" target="_blank">
18
+ <div class="icon">{% include icon/social/facebook.svg %}</div>
19
+ </a>
20
+ </div>
21
+ </li>
22
+ {% endif %}
23
+ {% if site.author.twitter %}
24
+ <li title="Follow me on Twitter.">
25
+ <div class="round-button twitter">
26
+ <a itemprop="sameAs" href="https://twitter.com/{{ site.author.twitter }}" target="_blank">
27
+ <div class="icon">{% include icon/social/twitter.svg %}</div>
28
+ </a>
29
+ </div>
30
+ </li>
31
+ {% endif %}
32
+ {% if site.author.googleplus %}
33
+ <li title="Follow me on Google+.">
34
+ <div class="round-button googlepluse">
35
+ <a itemprop="sameAs" href="https://plus.google.com/u/0/{{ site.author.googleplus }}" target="_blank">
36
+ <div class="icon">{% include icon/social/googleplus.svg %}</div>
37
+ </a>
38
+ </div>
39
+ </li>
40
+ {% endif %}
41
+ {% if site.author.github %}
42
+ <li title="Follow me on Github.">
43
+ <div class="round-button github">
44
+ <a itemprop="sameAs" href="https://github.com/{{ site.author.github }}" target="_blank">
45
+ <div class="icon">{% include icon/social/github.svg %}</div>
46
+ </a>
47
+ </div>
48
+ </li>
49
+ {% endif %}
50
+ {% if site.author.linkedin %}
51
+ <li title="Follow me on Linkedin.">
52
+ <div class="round-button linkedin">
53
+ <a itemprop="sameAs" href="https://www.linkedin.com/in/{{ site.author.linkedin }}" target="_blank">
54
+ <div class="icon">{% include icon/social/linkedin.svg %}</div>
55
+ </a>
56
+ </div>
57
+ </li>
58
+ {% endif %}
59
+ {% if site.author.douban %}
60
+ <li title="Follow me on Douban.">
61
+ <div class="round-button douban">
62
+ <a itemprop="sameAs" href="https://www.douban.com/people/{{ site.author.douban }}" target="_blank">
63
+ <div class="icon">{% include icon/social/douban.svg %}</div>
64
+ </a>
65
+ </div>
66
+ </li>
67
+ {% endif %}
68
+ </ul>
69
+ {% if site.author.email %}
70
+ <p class="email">
71
+ <a title="Send me Email." href="mailto:{{ site.author.email }}" target="_self"> {{ site.author.email }} </a>
72
+ </p>
73
+ {% endif %}
74
+ </div>
@@ -0,0 +1,8 @@
1
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
2
+ width="24px" height="24px" viewBox="0 0 24 24">
3
+ <style type="text/css">
4
+ .st0{fill:#666666;}
5
+ </style>
6
+ <path class="st0" d="M1.7,22.3c5.7-5.7,11.3-5.7,17,0c3.3-3.3,3.5-5.3,0.8-6c2.7,0.7,3.5-1.1,2.3-5.6s-3.3-5.2-6.3-2.1
7
+ c3-3,2.3-5.2-2.1-6.3S7,1.8,7.7,4.6C7,1.8,5,2.1,1.7,5.3C7.3,11,7.3,16.7,1.7,22.3"/>
8
+ </svg>
@@ -0,0 +1 @@
1
+ {{ page.url | replace:'index.html','' | prepend: site.baseurl | replace:'//','/' | prepend: site.url }}
@@ -0,0 +1 @@
1
+ {{ "/feed.xml" | prepend: site.baseurl | replace:'//','/' | prepend: site.url }}
@@ -0,0 +1,22 @@
1
+ {% if site.disqus.shortname and page.key %}
2
+ <div id="disqus_thread"></div>
3
+ <script>
4
+
5
+ /**
6
+ * RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
7
+ * LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
8
+
9
+ var disqus_config = function () {
10
+ this.page.url = '{% include snippets/page-url.html %}';
11
+ this.page.identifier = '{{ page.key }}';
12
+ };
13
+
14
+ (function() { // DON'T EDIT BELOW THIS LINE
15
+ var d = document, s = d.createElement('script');
16
+ s.src = 'https://{{ site.disqus.shortname }}.disqus.com/embed.js';
17
+ s.setAttribute('data-timestamp', +new Date());
18
+ (d.head || d.body).appendChild(s);
19
+ })();
20
+ </script>
21
+ <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
22
+ {% endif %}
@@ -0,0 +1,13 @@
1
+ {% if site.ga_tracking_id %}
2
+ <!-- Google Analytics -->
3
+ <script>
4
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
5
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
6
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
7
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
8
+
9
+ ga('create', '{{ site.ga_tracking_id }}', 'auto');
10
+ ga('send', 'pageview');
11
+ </script>
12
+ <!-- End Google Analytics -->
13
+ {% endif %}
@@ -0,0 +1,5 @@
1
+ {% if site.mathjax == true or page.mathjax == true %}
2
+ <script type="text/javascript" async
3
+ src="https://cdn.bootcss.com/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML">
4
+ </script>
5
+ {% endif %}
@@ -0,0 +1,114 @@
1
+ ---
2
+ layout: blog-default
3
+ title: All Posts
4
+ ---
5
+ <div class="m-all">
6
+ <div class="main">
7
+ <h1 class="js-page-heading">All Posts</h1>
8
+ {% include blog/tags.html %}
9
+ <!--group by year: http://stackoverflow.com/questions/19086284/jekyll-liquid-templating-how-to-group-blog-posts-by-year-->
10
+ <section class="js-year-wrapper">
11
+ {% for post in site.posts %}
12
+ {% assign currentdate = post.date | date: "%Y" %}
13
+ {% if currentdate != date %}
14
+ {% unless forloop.first %}</ul></section>{% endunless %}
15
+ <section id="{{ post.date | date: "%Y" }}">
16
+ <h2 class="year-title" id="year-{{ post.date | date: "%Y" }}">{{ currentdate }}</h2>
17
+ <ul class="year-list">
18
+ {% assign date = currentdate %}
19
+ {% endif %}
20
+ {% assign _tags = "" %}
21
+ {% for tag in post.tags %}
22
+ {% assign _tag = tag | strip | url_encode %}
23
+ {% assign _tags = _tags | append: ","" | append: _tag %}
24
+ {% endfor %}
25
+ {% assign last = _tags | size | minus: 1 %}
26
+ {% assign _tags = _tags | slice: 1, last %}
27
+ <li class="js-post-block" data-tag="{{ _tags }}">
28
+ <span class="post-date">{{ post.date | date:"%b %d" }}</span><a class="post-link" href="{{ post.url | prepend: site.baseurl | replace: '//', '/' }}">{{ post.title }}</a>
29
+ </li>
30
+ {% if forloop.last %}</ul></section>{% endif %}
31
+ {% endfor %}
32
+ </section>
33
+ </div>
34
+ </div>
35
+
36
+ <script type="text/javascript">
37
+ // function queryString is copied from
38
+ // http://stackoverflow.com/questions/979975/how-to-get-the-value-from-url-parameter#answer-979995
39
+ function queryString() {
40
+ // This function is anonymous, is executed immediately and
41
+ // the return value is assigned to QueryString!
42
+ var i = 0, queryObj = {}, pair;
43
+ var queryStr = window.location.search.substring(1);
44
+ var queryArr = queryStr.split('&');
45
+ for (i = 0; i < queryArr.length; i++) {
46
+ pair = queryArr[i].split('=');
47
+ // If first entry with this name
48
+ if (typeof queryObj[pair[0]] === 'undefined') {
49
+ queryObj[pair[0]] = pair[1];
50
+ // If second entry with this name
51
+ } else if (typeof queryObj[pair[0]] === 'string') {
52
+ queryObj[pair[0]] = [queryObj[pair[0]], pair[1]];
53
+ // If third or later entry with this name
54
+ } else {
55
+ queryObj[pair[0]].push(pair[1]);
56
+ }
57
+ }
58
+ return queryObj;
59
+ }
60
+
61
+ $(function() {
62
+ var $pageHeading = $('.js-page-heading');
63
+ var $articleTag = $('.js-article-tag');
64
+ var $tagShowAll = $('.js-tag-show-all');
65
+ var $postBlock = $('.js-post-block');
66
+ var $yearSection = $('.js-year-wrapper section');
67
+
68
+ window.tagSelect = function(tag) {
69
+ var i = 0, flag = false, cur, tagStr = '',
70
+ tags = [], _tag = '', lis = [];
71
+ if (tag === undefined || tag === '') {
72
+ $pageHeading.text('All Posts'); $tagShowAll.focus(); $postBlock.show();
73
+ } else {
74
+ tag = tag.trim();
75
+ // $articleTag.filter('.tag-' + tag).focus();
76
+ for (i = 0; i < $articleTag.length; i++) {
77
+ cur = $articleTag.eq(i); _tag = cur.data('tag');
78
+ if (typeof _tag === 'string' && _tag.trim() === tag) {
79
+ cur.focus(); tagStr = cur.children('span').text();
80
+ (typeof tagStr === 'string') && (tagStr = tagStr.trim());
81
+ $pageHeading.text('Tag: ' + tagStr); break;
82
+ }
83
+ }
84
+ $postBlock.each(function() {
85
+ flag = false, cur = $(this);
86
+ tags = cur.data('tag').split(',');
87
+ for (i = 0; i < tags.length; i++) {
88
+ _tag = tags[i].trim();
89
+ if (_tag === tag) {
90
+ flag = true; cur.show(); break;
91
+ }
92
+ }
93
+ flag || (cur.hide());
94
+ });
95
+ }
96
+ $yearSection.each(function() {
97
+ flag = false, cur = $(this);
98
+ lis = cur.find('li');
99
+ for (i = 0; i < lis.length; i++) {
100
+ if(lis.eq(i).css('display') !== 'none') {
101
+ flag = true; break;
102
+ }
103
+ }
104
+ flag ? cur.show() : cur.hide();
105
+ });
106
+ tag === undefined || window.history.replaceState(null, '', window.location.href.split('?')[0] + '?tag=' + tag);
107
+ }
108
+
109
+ var query = queryString();
110
+ var tag = undefined;
111
+ query.tag === undefined || (tag = query.tag);
112
+ tagSelect(tag);
113
+ });
114
+ </script>
@@ -0,0 +1,34 @@
1
+ <!DOCTYPE html>
2
+ <html lang="{{ site.lang }}">
3
+ <head>
4
+ {% include common-head.html %}
5
+ {% include head-icons-rel.html %}
6
+ <link rel="stylesheet" href="{{ "/assets/css/blog.css" | prepend: site.baseurl | replace:'//','/' }}">
7
+ <style>
8
+ {% if page.picture_frame == 'shadow' %}
9
+ .m-article-content img:not(.emoji) {
10
+ box-shadow: 0 0 5px rgba(0, 0, 0, .4);
11
+ }
12
+ {% endif %}
13
+ </style>
14
+ <script src="//cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>
15
+ {% include utils/mathjax.html %}
16
+ </head>
17
+ <body>
18
+ <div class="m-page-stage js-page-stage">
19
+ {{ content }}
20
+ </div>
21
+ {% include blog/footer.html %}
22
+ <script>
23
+ $(function() {
24
+ // display coding language //
25
+ $(".highlight").each(function() {
26
+ $(this).attr("data-lang", $(this).find("code").attr("data-lang"));
27
+ });
28
+ });
29
+ </script>
30
+ {% if ga_tracking_id and site.isdebug == false %}
31
+ {% include utils/google-analytics.html %}
32
+ {% endif %}
33
+ </body>
34
+ </html>
@@ -0,0 +1,9 @@
1
+ ---
2
+ layout: blog-base
3
+ ---
4
+ <div class="m-page-content">
5
+ {% include blog/header.html %}
6
+ <div class="m-page-main">
7
+ {{ content }}
8
+ </div>
9
+ </div>
@@ -0,0 +1,9 @@
1
+ ---
2
+ layout: blog-default
3
+ title: 404
4
+ ---
5
+ <div class="m-error-404">
6
+ <div class="main">
7
+ <h1>404</h1>
8
+ </div>
9
+ </div>
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html lang="{{ site.lang }}">
3
+ <head>
4
+ {% include common-head.html %}
5
+ {% include head-icons-rel.html %}
6
+ <link rel="stylesheet" href="{{ "/assets/css/home.css" | prepend: site.baseurl | replace:'//','/' }}">
7
+ <script src="//cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>
8
+ </head>
9
+ <body>
10
+ {{ content }}
11
+ {% if site.isdebug == false %}
12
+ {% include utils/google-analytics.html %}
13
+ {% endif %}
14
+ </body>
15
+ </html>
@@ -0,0 +1,92 @@
1
+ ---
2
+ layout: blog-default
3
+ title: Blog
4
+ ---
5
+ <div class="m-home">
6
+ <div class="main">
7
+ <div class="m-post-list">
8
+ {% for post in paginator.posts %}
9
+ <article>
10
+ <h1>
11
+ <a href="{{ post.url | prepend: site.baseurl | replace: '//', '/' }}">{{ post.title }}</a>
12
+ </h1>
13
+ <div class="m-article-content">
14
+ {% if site.excerpt_type == 'html' %}
15
+ {{ post.excerpt }}
16
+ {% else %}
17
+ {{ post.excerpt | strip_html | truncate: 350 }}
18
+ {% endif %}
19
+ </div>
20
+ <a href="{{ post.url | prepend: site.baseurl | replace: '//', '/' }}">Click to read more ...</a>
21
+ {% include blog/article-data.html %}
22
+ </article>
23
+ {% endfor %}
24
+ </div>
25
+ {% if paginator.total_pages > 1 %}
26
+ <nav class="m-pagination">
27
+ <p>{{ site.posts | size }} post articles, {{ paginator.total_pages }} pages.</p>
28
+ <ul class="inline-list">
29
+ {% if paginator.previous_page %}
30
+ <li><a class="round-button" href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">
31
+ <div class="icon icon--previous">{% include icon/previous.svg %}</div>
32
+ </a></li>
33
+ {% else %}
34
+ <li><div class="round-button inactive">
35
+ <div class="icon icon--prrevious">{% include icon/previous.svg %}</div>
36
+ </div></li>
37
+ {% endif %}
38
+ {% for page in (1..paginator.total_pages) %}
39
+ {% if page == paginator.page %}
40
+ <li><div class="round-button cur">
41
+ <span>{{ page }}</span>
42
+ </div></li>
43
+ {% elsif page == 1 %}
44
+ <li><a class="round-button"
45
+ href="{{ '/' | prepend: site.baseurl | replace: '//', '/' }}">
46
+ <span>{{ page }}</span>
47
+ </a></li>
48
+ {% else %}
49
+ <li><a class="round-button" href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}">
50
+ <span>{{ page }}</span>
51
+ </a></li>
52
+ {% endif %}
53
+ {% endfor %}
54
+ {% if paginator.next_page %}
55
+ <li><a class="round-button" href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">
56
+ <div class="icon icon--next">{% include icon/next.svg %}</div>
57
+ </a></li>
58
+ {% else %}
59
+ <li><div class="round-button inactive">
60
+ <div class="icon icon--next">{% include icon/next.svg %}</div>
61
+ </div></li>
62
+ {% endif %}
63
+ </ul>
64
+ </nav>
65
+ {% endif %}
66
+ </div>
67
+ </div>
68
+ {% if site.leancloud.app_id and site.leancloud.app_key and site.leancloud.app_class and site.isdebug == false %}
69
+ <script src="https://cdn1.lncld.net/static/js/av-min-1.2.1.js"></script>
70
+ <script>
71
+ $(function() {
72
+ AV.init({
73
+ appId: '{{ site.leancloud.app_id }}',
74
+ appKey: '{{ site.leancloud.app_key }}'
75
+ });
76
+ $(".article-view").each(function() {
77
+ var curId = this.id;
78
+ var query = new AV.Query('{{ site.leancloud.app_class }}');
79
+ query.equalTo('key', curId.substr(9));
80
+ query.first().then(function(result) {
81
+ if (result) {
82
+ $('#' + curId).text(result.attributes.views);
83
+ }
84
+ }, function(error) {
85
+ if (error) {
86
+ throw error;
87
+ }
88
+ });
89
+ });
90
+ });
91
+ </script>
92
+ {% endif %}
@@ -0,0 +1 @@
1
+ {{ content }}