hexo-theme-shokax 0.5.2 → 0.5.4

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 (161) hide show
  1. package/.vscode/settings.json +6 -0
  2. package/CODE_OF_CONDUCT.md +128 -128
  3. package/LICENSE +660 -660
  4. package/LICENSE-shoka +21 -21
  5. package/README.md +74 -74
  6. package/UsageRestrictions.md +25 -25
  7. package/_config.yml +355 -352
  8. package/languages/README.md +19 -19
  9. package/languages/default.yml +1 -1
  10. package/languages/en.yml +155 -155
  11. package/languages/ja.yml +155 -155
  12. package/languages/zh-CN.yml +155 -155
  13. package/languages/zh-HK.yml +155 -155
  14. package/languages/zh-TW.yml +155 -155
  15. package/layout/_alternate/atom.ejs +30 -30
  16. package/layout/_alternate/json.ejs +16 -16
  17. package/layout/_alternate/rss.ejs +34 -34
  18. package/layout/_mixin/breadcrumb.pug +33 -33
  19. package/layout/_mixin/card.pug +37 -37
  20. package/layout/_mixin/comment.pug +6 -6
  21. package/layout/_mixin/postmeta.pug +29 -29
  22. package/layout/_mixin/segment.pug +35 -35
  23. package/layout/_mixin/sidebar.pug +40 -40
  24. package/layout/_mixin/widgets.pug +28 -28
  25. package/layout/_partials/footer.pug +43 -43
  26. package/layout/_partials/head/head.pug +50 -50
  27. package/layout/_partials/head/head_com.pug +24 -24
  28. package/layout/_partials/head/pwa.pug +18 -18
  29. package/layout/_partials/header.pug +18 -18
  30. package/layout/_partials/layout.pug +138 -137
  31. package/layout/_partials/loading.pug +13 -13
  32. package/layout/_partials/pagination.pug +4 -4
  33. package/layout/_partials/post/copyright.pug +20 -20
  34. package/layout/_partials/post/footer.pug +20 -20
  35. package/layout/_partials/post/nav.pug +17 -17
  36. package/layout/_partials/post/post.pug +42 -42
  37. package/layout/_partials/post/reward.pug +18 -18
  38. package/layout/_partials/sidebar/menu.pug +37 -37
  39. package/layout/_partials/sidebar/overview.pug +42 -42
  40. package/layout/_partials/third-party/baidu-analytics.pug +11 -11
  41. package/layout/_partials/third-party/clarity.pug +8 -8
  42. package/layout/_partials/third-party/google-analytics.pug +9 -9
  43. package/layout/archive.pug +121 -121
  44. package/layout/category.pug +62 -62
  45. package/layout/index.pug +36 -36
  46. package/layout/page.pug +60 -60
  47. package/layout/post.pug +42 -42
  48. package/layout/tag.pug +46 -46
  49. package/package.json +6 -5
  50. package/scripts/generaters/script.js +2 -1
  51. package/scripts/plugin/check.js +13 -7
  52. package/source/assets/algolia_logo.svg +9 -9
  53. package/source/assets/logo.svg +16 -16
  54. package/source/css/_colors.styl +207 -207
  55. package/source/css/_common/components/components.styl +5 -5
  56. package/source/css/_common/components/pages/collapse.styl +119 -119
  57. package/source/css/_common/components/pages/home.styl +391 -391
  58. package/source/css/_common/components/pages/pages.styl +56 -56
  59. package/source/css/_common/components/pages/tag-cloud.styl +12 -12
  60. package/source/css/_common/components/post/breadcrumb.styl +39 -39
  61. package/source/css/_common/components/post/copyright.styl +41 -41
  62. package/source/css/_common/components/post/expand.styl +263 -263
  63. package/source/css/_common/components/post/footer.styl +11 -11
  64. package/source/css/_common/components/post/header.styl +79 -79
  65. package/source/css/_common/components/post/nav.styl +64 -64
  66. package/source/css/_common/components/post/post.styl +29 -29
  67. package/source/css/_common/components/post/reward.styl +50 -50
  68. package/source/css/_common/components/post/rtl.styl +12 -12
  69. package/source/css/_common/components/post/tags.styl +39 -39
  70. package/source/css/_common/components/tags/collapse.styl +72 -72
  71. package/source/css/_common/components/tags/container.styl +49 -49
  72. package/source/css/_common/components/tags/label.styl +12 -12
  73. package/source/css/_common/components/tags/links.styl +77 -77
  74. package/source/css/_common/components/tags/list.styl +131 -131
  75. package/source/css/_common/components/tags/note.styl +70 -70
  76. package/source/css/_common/components/tags/player.styl +361 -361
  77. package/source/css/_common/components/tags/quiz.styl +200 -200
  78. package/source/css/_common/components/tags/tabs.styl +89 -89
  79. package/source/css/_common/components/tags/tags.styl +9 -9
  80. package/source/css/_common/components/third-party/loading.styl +222 -222
  81. package/source/css/_common/components/third-party/mermaid/class.styl +90 -90
  82. package/source/css/_common/components/third-party/mermaid/flowchart.styl +72 -72
  83. package/source/css/_common/components/third-party/mermaid/gantt.styl +251 -251
  84. package/source/css/_common/components/third-party/mermaid/git.styl +7 -7
  85. package/source/css/_common/components/third-party/mermaid/mermaid.styl +37 -37
  86. package/source/css/_common/components/third-party/mermaid/pie.styl +9 -9
  87. package/source/css/_common/components/third-party/mermaid/sequence.styl +95 -95
  88. package/source/css/_common/components/third-party/mermaid/state.styl +130 -130
  89. package/source/css/_common/components/third-party/pace.styl +18 -18
  90. package/source/css/_common/components/third-party/search.styl +167 -167
  91. package/source/css/_common/components/third-party/theme.styl +151 -151
  92. package/source/css/_common/components/third-party/third-party.styl +22 -22
  93. package/source/css/_common/components/third-party/widgets.styl +57 -57
  94. package/source/css/_common/outline/footer/footer.styl +67 -67
  95. package/source/css/_common/outline/header/brand.styl +77 -77
  96. package/source/css/_common/outline/header/header.styl +20 -20
  97. package/source/css/_common/outline/header/image.styl +85 -85
  98. package/source/css/_common/outline/header/menu.styl +117 -117
  99. package/source/css/_common/outline/header/nav.styl +81 -81
  100. package/source/css/_common/outline/header/right.styl +15 -15
  101. package/source/css/_common/outline/header/tool.styl +207 -207
  102. package/source/css/_common/outline/header/waves.styl +57 -57
  103. package/source/css/_common/outline/mobile.styl +46 -46
  104. package/source/css/_common/outline/outline.styl +78 -78
  105. package/source/css/_common/outline/sidebar/author.styl +59 -59
  106. package/source/css/_common/outline/sidebar/dimmer.styl +23 -23
  107. package/source/css/_common/outline/sidebar/menu.styl +63 -63
  108. package/source/css/_common/outline/sidebar/quick.styl +43 -43
  109. package/source/css/_common/outline/sidebar/related.styl +56 -56
  110. package/source/css/_common/outline/sidebar/sidebar.styl +82 -82
  111. package/source/css/_common/outline/sidebar/social.styl +69 -69
  112. package/source/css/_common/outline/sidebar/state.styl +37 -37
  113. package/source/css/_common/outline/sidebar/tab.styl +71 -71
  114. package/source/css/_common/outline/sidebar/toc.styl +47 -47
  115. package/source/css/_common/scaffolding/animate.styl +322 -322
  116. package/source/css/_common/scaffolding/base.styl +192 -192
  117. package/source/css/_common/scaffolding/buttons.styl +48 -48
  118. package/source/css/_common/scaffolding/divider.styl +36 -36
  119. package/source/css/_common/scaffolding/iconfont.styl +443 -443
  120. package/source/css/_common/scaffolding/normalize.styl +273 -273
  121. package/source/css/_common/scaffolding/pagination.styl +81 -81
  122. package/source/css/_common/scaffolding/ribbon.styl +38 -38
  123. package/source/css/_common/scaffolding/scaffolding.styl +14 -14
  124. package/source/css/_common/scaffolding/scrollbar.styl +37 -37
  125. package/source/css/_common/scaffolding/tables.styl +50 -50
  126. package/source/css/_common/scaffolding/tip.styl +19 -19
  127. package/source/css/_common/scaffolding/toggles.styl +59 -59
  128. package/source/css/_iconfont.styl +455 -455
  129. package/source/css/_mixins.styl +148 -148
  130. package/source/css/_variables.styl +89 -89
  131. package/source/css/app.styl +25 -25
  132. package/source/css/mermaid.styl +5 -5
  133. package/source/css/page.styl +2 -2
  134. package/source/css/post.styl +4 -5
  135. package/source/css/scaffolding.styl +4 -4
  136. package/source/js/_app/components/cloudflare.ts +18 -18
  137. package/source/js/_app/components/comments.ts +88 -88
  138. package/source/js/_app/components/sidebar.ts +243 -243
  139. package/source/js/_app/components/tcomments.ts +53 -53
  140. package/source/js/_app/globals/globalVars.ts +84 -84
  141. package/source/js/_app/globals/handles.ts +124 -124
  142. package/source/js/_app/globals/themeColor.ts +62 -62
  143. package/source/js/_app/globals/thirdparty.ts +63 -63
  144. package/source/js/_app/globals/tools.ts +73 -73
  145. package/source/js/_app/library/anime.ts +121 -121
  146. package/source/js/_app/library/declare.d.ts +129 -128
  147. package/source/js/_app/library/proto.ts +70 -70
  148. package/source/js/_app/library/vue.ts +49 -49
  149. package/source/js/_app/page/common.ts +41 -41
  150. package/source/js/_app/page/imageviewer.ts +15 -15
  151. package/source/js/_app/page/post.ts +251 -252
  152. package/source/js/_app/page/search.ts +109 -109
  153. package/source/js/_app/page/tab.ts +59 -59
  154. package/source/js/_app/pjax/domInit.ts +102 -102
  155. package/source/js/_app/pjax/refresh.ts +115 -117
  156. package/source/js/_app/pjax/siteInit.ts +93 -90
  157. package/source/js/_app/player.ts +13 -13
  158. package/toolbox/compiler.mjs +49 -49
  159. package/toolbox/dev-version.mjs +14 -14
  160. package/toolbox/hoistdep.mjs +5 -5
  161. package/toolbox/lib.mjs +63 -63
@@ -1,37 +1,37 @@
1
- mixin item(name, path, parent, sublist)
2
- - var trimn = (str)=>{return str!=null?str.trim():"";}
3
- - var path = path.split('||')
4
- - var itemURL = path[0].trim()
5
- - if (!itemURL.startsWith('http')){ itemURL = itemURL.replace('//', '/') }
6
- - var menuIcon = '<i class="ic i-' + trimn(path[1]) + '"></i>'
7
- - var menuText = __('menu.' + name).replace('menu.', '')
8
- if parent
9
- li(class="item dropdown")
10
- if itemURL === '/'
11
- a(href="#" onclick="return false;")
12
- != menuIcon + menuText
13
- else
14
- != _url(itemURL, menuIcon + menuText, {rel: 'section'})
15
- ul(class="submenu")
16
- each subvalue, subname in sublist
17
- - var path = subvalue.split('||')
18
- - var itemURL = path[0].trim()
19
- - if (itemURL==='/') itemURL='javascript:void(0)'
20
- - var menuText = __('menu.' + subname).replace('menu.', '')
21
- if subname === 'default'
22
- - var menuText = __('menu.' + name).replace('menu.', '')
23
- else
24
- - var menuIcon = '<i class="ic i-' + trimn(path[1]) + '"></i>'
25
- li(class="item")
26
- != _url(itemURL, menuIcon + menuText, {rel: 'section'})
27
- else
28
- li(class="item")
29
- != _url(itemURL, menuIcon + menuText, {rel: 'section'})
30
-
31
- each value, name in theme.menu
32
- if value.toString() === '[object Object]'
33
- each subvalue, subname in value
34
- if subname === 'default'
35
- +item(name, subvalue, true, value)
36
- else
37
- +item(name, value)
1
+ mixin item(name, path, parent, sublist)
2
+ - var trimn = (str)=>{return str!=null?str.trim():"";}
3
+ - var path = path.split('||')
4
+ - var itemURL = path[0].trim()
5
+ - if (!itemURL.startsWith('http')){ itemURL = itemURL.replace('//', '/') }
6
+ - var menuIcon = '<i class="ic i-' + trimn(path[1]) + '"></i>'
7
+ - var menuText = __('menu.' + name).replace('menu.', '')
8
+ if parent
9
+ li(class="item dropdown")
10
+ if itemURL === '/'
11
+ a(href="#" onclick="return false;")
12
+ != menuIcon + menuText
13
+ else
14
+ != _url(itemURL, menuIcon + menuText, {rel: 'section'})
15
+ ul(class="submenu")
16
+ each subvalue, subname in sublist
17
+ - var path = subvalue.split('||')
18
+ - var itemURL = path[0].trim()
19
+ - if (itemURL==='/') itemURL='javascript:void(0)'
20
+ - var menuText = __('menu.' + subname).replace('menu.', '')
21
+ if subname === 'default'
22
+ - var menuText = __('menu.' + name).replace('menu.', '')
23
+ else
24
+ - var menuIcon = '<i class="ic i-' + trimn(path[1]) + '"></i>'
25
+ li(class="item")
26
+ != _url(itemURL, menuIcon + menuText, {rel: 'section'})
27
+ else
28
+ li(class="item")
29
+ != _url(itemURL, menuIcon + menuText, {rel: 'section'})
30
+
31
+ each value, name in theme.menu
32
+ if value.toString() === '[object Object]'
33
+ each subvalue, subname in value
34
+ if subname === 'default'
35
+ +item(name, subvalue, true, value)
36
+ else
37
+ +item(name, value)
@@ -1,42 +1,42 @@
1
- div(class="author" itemprop="author" itemscope itemtype="http://schema.org/Person")
2
- img(loading="lazy" decoding="async" class="image" itemprop="image" alt=author
3
- src=url_for(theme.statics + theme.assets + '/'+ theme.sidebar.avatar))
4
- p(class="name" itemprop="name")
5
- != author
6
- div(class="description" itemprop="description")
7
- != description
8
-
9
- nav(class="state")
10
- if config.archive_dir !== '/' && site.posts.length > 0
11
- div(class="item posts")
12
- a(href=url_for(config.archive_dir + '/'))
13
- span(class="count")
14
- != site.posts.length
15
- span(class="name")
16
- != __('state.posts')
17
- if config.category_dir !== '/' && site.categories.length > 0
18
- div(class="item categories")
19
- a(href=url_for(config.category_dir + '/'))
20
- span(class="count")
21
- != site.categories.length
22
- span(class="name")
23
- != __('state.categories')
24
- if config.tag_dir !== '/' && site.tags.length > 0
25
- div(class="item tags")
26
- a(href=url_for(config.tag_dir + '/'))
27
- span(class="count")
28
- != site.tags.length
29
- span(class="name")
30
- != __('state.tags')
31
-
32
- div(class="social")
33
- if theme.social
34
- each link, name in theme.social
35
- - var sidebarURL = link.split('||')[0].trim()
36
- - var sidebarIcon = '<i class="ic i-' + link.split('||')[1].trim() + '"></i>'
37
- != _url(sidebarURL, sidebarIcon, {title: sidebarURL, class: 'item ' + name})
38
-
39
- != shokax_inject('sidebar')
40
-
41
- div(class="menu")
42
- != partial('_partials/sidebar/menu.pug')
1
+ div(class="author" itemprop="author" itemscope itemtype="http://schema.org/Person")
2
+ img(loading="lazy" decoding="async" class="image" itemprop="image" alt=author
3
+ src=url_for(theme.statics + theme.assets + '/'+ theme.sidebar.avatar))
4
+ p(class="name" itemprop="name")
5
+ != author
6
+ div(class="description" itemprop="description")
7
+ != description
8
+
9
+ nav(class="state")
10
+ if config.archive_dir !== '/' && site.posts.length > 0
11
+ div(class="item posts")
12
+ a(href=url_for(config.archive_dir + '/'))
13
+ span(class="count")
14
+ != site.posts.length
15
+ span(class="name")
16
+ != __('state.posts')
17
+ if config.category_dir !== '/' && site.categories.length > 0
18
+ div(class="item categories")
19
+ a(href=url_for(config.category_dir + '/'))
20
+ span(class="count")
21
+ != site.categories.length
22
+ span(class="name")
23
+ != __('state.categories')
24
+ if config.tag_dir !== '/' && site.tags.length > 0
25
+ div(class="item tags")
26
+ a(href=url_for(config.tag_dir + '/'))
27
+ span(class="count")
28
+ != site.tags.length
29
+ span(class="name")
30
+ != __('state.tags')
31
+
32
+ div(class="social")
33
+ if theme.social
34
+ each link, name in theme.social
35
+ - var sidebarURL = link.split('||')[0].trim()
36
+ - var sidebarIcon = '<i class="ic i-' + link.split('||')[1].trim() + '"></i>'
37
+ != _url(sidebarURL, sidebarIcon, {title: sidebarURL, class: 'item ' + name})
38
+
39
+ != shokax_inject('sidebar')
40
+
41
+ div(class="menu")
42
+ != partial('_partials/sidebar/menu.pug')
@@ -1,11 +1,11 @@
1
- - var hmSrc = `https://hm.baidu.com/hm.js?${ theme.visitor.baiduAnalytics }`
2
- if theme.visitor.baiduAnalytics
3
- script.
4
- var _hmt = _hmt || [];
5
- (function () {
6
- const hm = document.createElement("script");
7
- hm.src = "#{hmSrc}"
8
- hm.async = true;
9
- const s = document.getElementsByTagName("script")[0];
10
- s.parentNode.insertBefore(hm, s);
11
- })();
1
+ - var hmSrc = `https://hm.baidu.com/hm.js?${ theme.visitor.baiduAnalytics }`
2
+ if theme.visitor.baiduAnalytics
3
+ script.
4
+ var _hmt = _hmt || [];
5
+ (function () {
6
+ const hm = document.createElement("script");
7
+ hm.src = "#{hmSrc}"
8
+ hm.async = true;
9
+ const s = document.getElementsByTagName("script")[0];
10
+ s.parentNode.insertBefore(hm, s);
11
+ })();
@@ -1,8 +1,8 @@
1
- - var code = theme?.visitor?.clarity
2
- if code
3
- script.
4
- (function(c,l,a,r,i,t,y){
5
- c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
6
- t=l.createElement(r);t.async=true;t.src="https://www.clarity.ms/tag/"+i;
7
- y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
8
- })(window, document, "clarity", "script", "#{code}");
1
+ - var code = theme?.visitor?.clarity
2
+ if code
3
+ script.
4
+ (function(c,l,a,r,i,t,y){
5
+ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
6
+ t=l.createElement(r);t.async=true;t.src="https://www.clarity.ms/tag/"+i;
7
+ y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
8
+ })(window, document, "clarity", "script", "#{code}");
@@ -1,10 +1,10 @@
1
- - var googleId = theme.visitor.googleAnalytics
2
- if googleId
3
- script(async, src=`https://www.googletagmanager.com/gtag/js?id=${ googleId }`)
4
- script.
5
- window.dataLayer = window.dataLayer || [];
6
- function gtag() {
7
- dataLayer.push(arguments);
8
- }
9
- gtag('js', new Date());
1
+ - var googleId = theme.visitor.googleAnalytics
2
+ if googleId
3
+ script(async, src=`https://www.googletagmanager.com/gtag/js?id=${ googleId }`)
4
+ script.
5
+ window.dataLayer = window.dataLayer || [];
6
+ function gtag() {
7
+ dataLayer.push(arguments);
8
+ }
9
+ gtag('js', new Date());
10
10
  gtag('config', '#{googleId}');
@@ -1,121 +1,121 @@
1
- extends _partials/layout.pug
2
-
3
- block head
4
- != _css('page.css')
5
-
6
- block title
7
- if is_month()
8
- != `${page.year}${__('symbol.year')}/${page.month}${__('symbol.month')}`
9
- else if is_year()
10
- != `${page.year}${__('symbol.year')}`
11
- != `${__('title.archive')}`
12
-
13
- block header
14
- h1(itemprop="name headline")
15
- if is_month()
16
- != _p('title.archive_in', page.year + __('symbol.year') + page.month + __('symbol.month'))
17
- else if is_year()
18
- != _p('title.archive_in', page.year + __('symbol.year'))
19
- else
20
- != __('title.archive')
21
-
22
- block content
23
- div(class="collapse wrap")
24
- h2(class="item header")
25
- if is_month()
26
- a(href=url_for(config.archive_dir))
27
- != __('title.all')
28
- small /
29
- a(href=url_for(config.archive_dir + '/' + page.year ))
30
- != `${page.year} ${__('symbol.year')}`
31
- small /
32
- != `${page.month}${__('symbol.month')}`
33
- small
34
- != __('title.archive')
35
- else if is_year()
36
- a(href=url_for(config.archive_dir))
37
- != __('title.all')
38
- small /
39
- != page.year + __('symbol.year')
40
- small
41
- != __('title.archive')
42
- else
43
- a(href=url_for(site.path))
44
- != __('menu.home')
45
- small /
46
- - var posts_length = site.posts.length,cheers
47
- if posts_length > 210
48
- - cheers = 'excellent'
49
- else if posts_length > 130
50
- - cheers = 'great'
51
- else if posts_length > 80
52
- - cheers = 'good'
53
- else if posts_length > 50
54
- - cheers = 'nice'
55
- else if posts_length > 30
56
- - cheers = 'ok'
57
- else
58
- - cheers = 'um'
59
- != _p('counter.archive_posts', site.posts.length)
60
- small(class="cheers")
61
- != __('cheers.' + cheers)
62
- != ' '
63
- != __('keep_on')
64
-
65
- - var current_year = '1970'
66
- - var current_month = '01'
67
- - var count_post = 1
68
- each post in page.posts.toArray()
69
- - var year = date(post.date, 'YYYY')
70
- - var month = date(post.date, 'MM')
71
- if !is_year()
72
- if year !== current_year || month !== current_month
73
- if current_year !== '1970'
74
- small (#{count_post})
75
- </h3>
76
- <h3 class="item section">
77
- a(href=url_for(config.archive_dir + '/' + year )) #{year} #{__('symbol.year')}
78
- small /
79
- a(href=url_for(config.archive_dir + '/' + year + '/' + month)) #{ month } #{__('symbol.month')}
80
- - current_year = year
81
- - current_month = month
82
- - count_post = 1
83
- else
84
- - count_post = count_post + 1
85
- else
86
- if year !== current_year && !is_year()
87
- - current_year = year
88
- h3(class="item section")
89
- a(href=url_for(config.archive_dir + '/' + year )) #{ year } #{__('symbol.year')}
90
- if month !== current_month && is_year() && !is_month()
91
- - current_month = month
92
- h3(class="item section")
93
- a(href=url_for(config.archive_dir + '/' + year + '/' + month)) #{ month } #{__('symbol.month')}
94
- article(class="item normal" itemscope itemtype="http://schema.org/Article")
95
- div(class="meta")
96
- time(
97
- itemprop="dateCreated"
98
- datetime=moment(post.date).format()
99
- content=date(post.date, config.date_format)
100
- ) #{date(post.date, 'MM-DD')}
101
- if post.categories && post.categories.length
102
- - var cat_length = post.categories.length
103
- each cat,index in post.categories.toArray()
104
- if index === cat_length && cat.name !== page.category
105
- span
106
- a(href=url_for(cat.path)) #{cat.name}
107
- div(class="title")
108
- if post.link
109
- - var postTitleIcon = '<i class="ic i-link-alt"></i>'
110
- - var postText = post.title || post.link
111
- != _url(post.link, postText + postTitleIcon, {class: 'external', itemprop: 'url'})
112
- else
113
- - var postTitle = post.title || __('post.untitled')
114
- a(href=url_for(post.path) itemprop="url")
115
- span(itemprop="name") #{postTitle}
116
- if !is_year()
117
- small (#{count_post})
118
- </h3>
119
-
120
- include _partials/pagination.pug
121
-
1
+ extends _partials/layout.pug
2
+
3
+ block head
4
+ != _css('page.css')
5
+
6
+ block title
7
+ if is_month()
8
+ != `${page.year}${__('symbol.year')}/${page.month}${__('symbol.month')}`
9
+ else if is_year()
10
+ != `${page.year}${__('symbol.year')}`
11
+ != `${__('title.archive')}`
12
+
13
+ block header
14
+ h1(itemprop="name headline")
15
+ if is_month()
16
+ != _p('title.archive_in', page.year + __('symbol.year') + page.month + __('symbol.month'))
17
+ else if is_year()
18
+ != _p('title.archive_in', page.year + __('symbol.year'))
19
+ else
20
+ != __('title.archive')
21
+
22
+ block content
23
+ div(class="collapse wrap")
24
+ h2(class="item header")
25
+ if is_month()
26
+ a(href=url_for(config.archive_dir))
27
+ != __('title.all')
28
+ small /
29
+ a(href=url_for(config.archive_dir + '/' + page.year ))
30
+ != `${page.year} ${__('symbol.year')}`
31
+ small /
32
+ != `${page.month}${__('symbol.month')}`
33
+ small
34
+ != __('title.archive')
35
+ else if is_year()
36
+ a(href=url_for(config.archive_dir))
37
+ != __('title.all')
38
+ small /
39
+ != page.year + __('symbol.year')
40
+ small
41
+ != __('title.archive')
42
+ else
43
+ a(href=url_for(site.path))
44
+ != __('menu.home')
45
+ small /
46
+ - var posts_length = site.posts.length,cheers
47
+ if posts_length > 210
48
+ - cheers = 'excellent'
49
+ else if posts_length > 130
50
+ - cheers = 'great'
51
+ else if posts_length > 80
52
+ - cheers = 'good'
53
+ else if posts_length > 50
54
+ - cheers = 'nice'
55
+ else if posts_length > 30
56
+ - cheers = 'ok'
57
+ else
58
+ - cheers = 'um'
59
+ != _p('counter.archive_posts', site.posts.length)
60
+ small(class="cheers")
61
+ != __('cheers.' + cheers)
62
+ != ' '
63
+ != __('keep_on')
64
+
65
+ - var current_year = '1970'
66
+ - var current_month = '01'
67
+ - var count_post = 1
68
+ each post in page.posts.toArray()
69
+ - var year = date(post.date, 'YYYY')
70
+ - var month = date(post.date, 'MM')
71
+ if !is_year()
72
+ if year !== current_year || month !== current_month
73
+ if current_year !== '1970'
74
+ small (#{count_post})
75
+ </h3>
76
+ <h3 class="item section">
77
+ a(href=url_for(config.archive_dir + '/' + year )) #{year} #{__('symbol.year')}
78
+ small /
79
+ a(href=url_for(config.archive_dir + '/' + year + '/' + month)) #{ month } #{__('symbol.month')}
80
+ - current_year = year
81
+ - current_month = month
82
+ - count_post = 1
83
+ else
84
+ - count_post = count_post + 1
85
+ else
86
+ if year !== current_year && !is_year()
87
+ - current_year = year
88
+ h3(class="item section")
89
+ a(href=url_for(config.archive_dir + '/' + year )) #{ year } #{__('symbol.year')}
90
+ if month !== current_month && is_year() && !is_month()
91
+ - current_month = month
92
+ h3(class="item section")
93
+ a(href=url_for(config.archive_dir + '/' + year + '/' + month)) #{ month } #{__('symbol.month')}
94
+ article(class="item normal" itemscope itemtype="http://schema.org/Article")
95
+ div(class="meta")
96
+ time(
97
+ itemprop="dateCreated"
98
+ datetime=moment(post.date).format()
99
+ content=date(post.date, config.date_format)
100
+ ) #{date(post.date, 'MM-DD')}
101
+ if post.categories && post.categories.length
102
+ - var cat_length = post.categories.length
103
+ each cat,index in post.categories.toArray()
104
+ if index === cat_length && cat.name !== page.category
105
+ span
106
+ a(href=url_for(cat.path)) #{cat.name}
107
+ div(class="title")
108
+ if post.link
109
+ - var postTitleIcon = '<i class="ic i-link-alt"></i>'
110
+ - var postText = post.title || post.link
111
+ != _url(post.link, postText + postTitleIcon, {class: 'external', itemprop: 'url'})
112
+ else
113
+ - var postTitle = post.title || __('post.untitled')
114
+ a(href=url_for(post.path) itemprop="url")
115
+ span(itemprop="name") #{postTitle}
116
+ if !is_year()
117
+ small (#{count_post})
118
+ </h3>
119
+
120
+ include _partials/pagination.pug
121
+
@@ -1,62 +1,62 @@
1
- extends ./_partials/layout.pug
2
-
3
- block head
4
- != _css('page.css')
5
-
6
- block title
7
- != `${__('title.category')}${__('symbol.colon')}${page.category}`
8
-
9
- block header
10
- h1(itemprop="name headline")
11
- != _p('title.category_in', page.title)
12
-
13
- block content
14
- div(class="collapse wrap")
15
- - var prev = _category_prev(page.category)
16
- h2(class="item header")
17
- a(href=url_for(config.category_dir)) #{__('title.all')}
18
- if prev
19
- small /
20
- != prev
21
- small /
22
- != page.title
23
- small #{__('title.category')}
24
- - var posts = page.posts
25
- - var current = "c"
26
- - var lastcat = ""
27
- - var lastcatslug = ""
28
- each post in posts.toArray()
29
- if post.categories && post.categories.length
30
- - var cat_length = post.categories.length
31
- each cat,index in post.categories.toArray()
32
- if cat.name === page.title
33
- - lastcat = ""
34
- - lastcatslug = ""
35
- else
36
- - lastcat += `<a href=${url_for(cat.path)}>${cat.name}</a><small>`
37
- if index >= post.categories.toArray().length - 1
38
- - lastcat = lastcat+' ( '+cat.length+' ) '+`</small>`
39
- else
40
- - lastcat = lastcat+'/'+`</small>`
41
- - lastcatslug = lastcatslug + cat.slug
42
- if lastcat && lastcatslug && lastcatslug !== current
43
- h3(class="item section")
44
- !=lastcat
45
- - current = lastcatslug
46
- article(class="item normal" itemscope itemtype="http://schema.org/Article")
47
- div(class="meta")
48
- time(
49
- itemprop="dateCreated"
50
- datetime=moment(post.date).format()
51
- content=date(post.date, config.date_format)
52
- ) #{date(post.date, 'MM-DD')}
53
- div(class="title")
54
- if post.link
55
- - var postTitleIcon = '<i class="ic i-link-alt"></i>'
56
- - var postText = post.title || post.link
57
- != _url(post.link, postText + postTitleIcon, {class: 'external', itemprop: 'url'})
58
- else
59
- a(href=url_for(post.path) itemprop="url")
60
- span(itemprop="name")
61
- != post.title || __('post.untitled')
62
- include _partials/pagination.pug
1
+ extends ./_partials/layout.pug
2
+
3
+ block head
4
+ != _css('page.css')
5
+
6
+ block title
7
+ != `${__('title.category')}${__('symbol.colon')}${page.category}`
8
+
9
+ block header
10
+ h1(itemprop="name headline")
11
+ != _p('title.category_in', page.title)
12
+
13
+ block content
14
+ div(class="collapse wrap")
15
+ - var prev = _category_prev(page.category)
16
+ h2(class="item header")
17
+ a(href=url_for(config.category_dir)) #{__('title.all')}
18
+ if prev
19
+ small /
20
+ != prev
21
+ small /
22
+ != page.title
23
+ small #{__('title.category')}
24
+ - var posts = page.posts
25
+ - var current = "c"
26
+ - var lastcat = ""
27
+ - var lastcatslug = ""
28
+ each post in posts.toArray()
29
+ if post.categories && post.categories.length
30
+ - var cat_length = post.categories.length
31
+ each cat,index in post.categories.toArray()
32
+ if cat.name === page.title
33
+ - lastcat = ""
34
+ - lastcatslug = ""
35
+ else
36
+ - lastcat += `<a href=${url_for(cat.path)}>${cat.name}</a><small>`
37
+ if index >= post.categories.toArray().length - 1
38
+ - lastcat = lastcat+' ( '+cat.length+' ) '+`</small>`
39
+ else
40
+ - lastcat = lastcat+'/'+`</small>`
41
+ - lastcatslug = lastcatslug + cat.slug
42
+ if lastcat && lastcatslug && lastcatslug !== current
43
+ h3(class="item section")
44
+ !=lastcat
45
+ - current = lastcatslug
46
+ article(class="item normal" itemscope itemtype="http://schema.org/Article")
47
+ div(class="meta")
48
+ time(
49
+ itemprop="dateCreated"
50
+ datetime=moment(post.date).format()
51
+ content=date(post.date, config.date_format)
52
+ ) #{date(post.date, 'MM-DD')}
53
+ div(class="title")
54
+ if post.link
55
+ - var postTitleIcon = '<i class="ic i-link-alt"></i>'
56
+ - var postText = post.title || post.link
57
+ != _url(post.link, postText + postTitleIcon, {class: 'external', itemprop: 'url'})
58
+ else
59
+ a(href=url_for(post.path) itemprop="url")
60
+ span(itemprop="name")
61
+ != post.title || __('post.untitled')
62
+ include _partials/pagination.pug