hexo-theme-shokax 0.5.0 → 0.5.2

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 (165) hide show
  1. package/CODE_OF_CONDUCT.md +128 -128
  2. package/LICENSE +660 -660
  3. package/LICENSE-shoka +21 -21
  4. package/README.md +74 -53
  5. package/UsageRestrictions.md +25 -25
  6. package/_config.yml +352 -350
  7. package/languages/README.md +19 -19
  8. package/languages/default.yml +1 -1
  9. package/languages/en.yml +155 -155
  10. package/languages/ja.yml +155 -155
  11. package/languages/zh-CN.yml +155 -155
  12. package/languages/zh-HK.yml +155 -155
  13. package/languages/zh-TW.yml +155 -155
  14. package/layout/_alternate/atom.ejs +30 -30
  15. package/layout/_alternate/json.ejs +16 -16
  16. package/layout/_alternate/rss.ejs +34 -34
  17. package/layout/_mixin/breadcrumb.pug +33 -33
  18. package/layout/_mixin/card.pug +37 -37
  19. package/layout/_mixin/comment.pug +6 -6
  20. package/layout/_mixin/postmeta.pug +29 -29
  21. package/layout/_mixin/segment.pug +35 -35
  22. package/layout/_mixin/sidebar.pug +40 -40
  23. package/layout/_mixin/widgets.pug +28 -28
  24. package/layout/_partials/footer.pug +43 -43
  25. package/layout/_partials/head/head.pug +50 -50
  26. package/layout/_partials/head/head_com.pug +24 -24
  27. package/layout/_partials/head/pwa.pug +18 -18
  28. package/layout/_partials/header.pug +18 -18
  29. package/layout/_partials/layout.pug +137 -137
  30. package/layout/_partials/loading.pug +13 -13
  31. package/layout/_partials/pagination.pug +4 -4
  32. package/layout/_partials/post/copyright.pug +20 -20
  33. package/layout/_partials/post/footer.pug +20 -20
  34. package/layout/_partials/post/nav.pug +17 -17
  35. package/layout/_partials/post/post.pug +42 -42
  36. package/layout/_partials/post/reward.pug +18 -18
  37. package/layout/_partials/sidebar/menu.pug +37 -37
  38. package/layout/_partials/sidebar/overview.pug +42 -42
  39. package/layout/_partials/third-party/baidu-analytics.pug +11 -11
  40. package/layout/_partials/third-party/clarity.pug +8 -8
  41. package/layout/_partials/third-party/google-analytics.pug +9 -9
  42. package/layout/archive.pug +121 -121
  43. package/layout/category.pug +62 -62
  44. package/layout/index.pug +36 -36
  45. package/layout/page.pug +60 -60
  46. package/layout/post.pug +42 -42
  47. package/layout/tag.pug +46 -46
  48. package/package.json +14 -14
  49. package/scripts/generaters/images.js +11 -13
  50. package/scripts/generaters/script.js +3 -1
  51. package/scripts/helpers/engine.js +5 -0
  52. package/scripts/plugin/check.js +48 -10
  53. package/scripts/plugin/index.js +2 -2
  54. package/source/assets/algolia_logo.svg +9 -9
  55. package/source/assets/logo.svg +16 -16
  56. package/source/css/_colors.styl +207 -207
  57. package/source/css/_common/components/components.styl +5 -6
  58. package/source/css/_common/components/pages/collapse.styl +119 -119
  59. package/source/css/_common/components/pages/home.styl +391 -391
  60. package/source/css/_common/components/pages/pages.styl +56 -56
  61. package/source/css/_common/components/pages/tag-cloud.styl +12 -12
  62. package/source/css/_common/components/post/breadcrumb.styl +39 -39
  63. package/source/css/_common/components/post/copyright.styl +41 -41
  64. package/source/css/_common/components/post/expand.styl +263 -263
  65. package/source/css/_common/components/post/footer.styl +11 -11
  66. package/source/css/_common/components/post/header.styl +79 -79
  67. package/source/css/_common/components/post/nav.styl +64 -64
  68. package/source/css/_common/components/post/post.styl +29 -29
  69. package/source/css/_common/components/post/reward.styl +50 -50
  70. package/source/css/_common/components/post/rtl.styl +12 -12
  71. package/source/css/_common/components/post/tags.styl +39 -39
  72. package/source/css/_common/components/tags/collapse.styl +72 -72
  73. package/source/css/_common/components/tags/container.styl +49 -49
  74. package/source/css/_common/components/tags/label.styl +12 -12
  75. package/source/css/_common/components/tags/links.styl +77 -77
  76. package/source/css/_common/components/tags/list.styl +131 -131
  77. package/source/css/_common/components/tags/note.styl +70 -70
  78. package/source/css/_common/components/tags/player.styl +361 -361
  79. package/source/css/_common/components/tags/quiz.styl +200 -200
  80. package/source/css/_common/components/tags/tabs.styl +89 -89
  81. package/source/css/_common/components/tags/tags.styl +9 -9
  82. package/source/css/_common/components/third-party/loading.styl +222 -222
  83. package/source/css/_common/components/third-party/mermaid/class.styl +90 -90
  84. package/source/css/_common/components/third-party/mermaid/flowchart.styl +72 -72
  85. package/source/css/_common/components/third-party/mermaid/gantt.styl +251 -251
  86. package/source/css/_common/components/third-party/mermaid/git.styl +7 -7
  87. package/source/css/_common/components/third-party/mermaid/mermaid.styl +37 -37
  88. package/source/css/_common/components/third-party/mermaid/pie.styl +9 -9
  89. package/source/css/_common/components/third-party/mermaid/sequence.styl +95 -95
  90. package/source/css/_common/components/third-party/mermaid/state.styl +130 -130
  91. package/source/css/_common/components/third-party/pace.styl +18 -18
  92. package/source/css/_common/components/third-party/search.styl +167 -167
  93. package/source/css/_common/components/third-party/theme.styl +151 -151
  94. package/source/css/_common/components/third-party/third-party.styl +22 -22
  95. package/source/css/_common/components/third-party/widgets.styl +57 -57
  96. package/source/css/_common/outline/footer/footer.styl +67 -67
  97. package/source/css/_common/outline/header/brand.styl +77 -77
  98. package/source/css/_common/outline/header/header.styl +20 -20
  99. package/source/css/_common/outline/header/image.styl +85 -85
  100. package/source/css/_common/outline/header/menu.styl +117 -117
  101. package/source/css/_common/outline/header/nav.styl +81 -81
  102. package/source/css/_common/outline/header/right.styl +15 -15
  103. package/source/css/_common/outline/header/tool.styl +207 -207
  104. package/source/css/_common/outline/header/waves.styl +57 -57
  105. package/source/css/_common/outline/mobile.styl +46 -46
  106. package/source/css/_common/outline/outline.styl +78 -78
  107. package/source/css/_common/outline/sidebar/author.styl +59 -59
  108. package/source/css/_common/outline/sidebar/dimmer.styl +23 -23
  109. package/source/css/_common/outline/sidebar/menu.styl +63 -63
  110. package/source/css/_common/outline/sidebar/quick.styl +43 -43
  111. package/source/css/_common/outline/sidebar/related.styl +56 -56
  112. package/source/css/_common/outline/sidebar/sidebar.styl +82 -82
  113. package/source/css/_common/outline/sidebar/social.styl +69 -69
  114. package/source/css/_common/outline/sidebar/state.styl +37 -37
  115. package/source/css/_common/outline/sidebar/tab.styl +71 -71
  116. package/source/css/_common/outline/sidebar/toc.styl +47 -47
  117. package/source/css/_common/scaffolding/animate.styl +322 -322
  118. package/source/css/_common/scaffolding/base.styl +192 -190
  119. package/source/css/_common/scaffolding/buttons.styl +48 -48
  120. package/source/css/_common/scaffolding/divider.styl +36 -36
  121. package/source/css/_common/scaffolding/iconfont.styl +443 -443
  122. package/source/css/_common/scaffolding/normalize.styl +273 -273
  123. package/source/css/_common/scaffolding/pagination.styl +81 -81
  124. package/source/css/_common/scaffolding/ribbon.styl +38 -38
  125. package/source/css/_common/scaffolding/scaffolding.styl +14 -14
  126. package/source/css/_common/scaffolding/scrollbar.styl +37 -37
  127. package/source/css/_common/scaffolding/tables.styl +50 -50
  128. package/source/css/_common/scaffolding/tip.styl +19 -19
  129. package/source/css/_common/scaffolding/toggles.styl +59 -59
  130. package/source/css/_iconfont.styl +455 -455
  131. package/source/css/_mixins.styl +148 -148
  132. package/source/css/_variables.styl +89 -89
  133. package/source/css/app.styl +25 -25
  134. package/source/css/mermaid.styl +5 -5
  135. package/source/css/page.styl +2 -2
  136. package/source/css/post.styl +6 -5
  137. package/source/css/scaffolding.styl +4 -4
  138. package/source/js/_app/components/cloudflare.ts +18 -18
  139. package/source/js/_app/components/comments.ts +88 -86
  140. package/source/js/_app/components/sidebar.ts +243 -243
  141. package/source/js/_app/components/tcomments.ts +53 -53
  142. package/source/js/_app/globals/globalVars.ts +84 -84
  143. package/source/js/_app/globals/handles.ts +124 -124
  144. package/source/js/_app/globals/themeColor.ts +62 -62
  145. package/source/js/_app/globals/thirdparty.ts +63 -63
  146. package/source/js/_app/globals/tools.ts +73 -73
  147. package/source/js/_app/library/anime.ts +121 -121
  148. package/source/js/_app/library/declare.d.ts +128 -126
  149. package/source/js/_app/library/proto.ts +70 -70
  150. package/source/js/_app/library/vue.ts +49 -49
  151. package/source/js/_app/page/common.ts +41 -41
  152. package/source/js/_app/page/imageviewer.ts +15 -15
  153. package/source/js/_app/page/post.ts +252 -248
  154. package/source/js/_app/page/search.ts +109 -109
  155. package/source/js/_app/page/tab.ts +59 -59
  156. package/source/js/_app/pjax/domInit.ts +102 -102
  157. package/source/js/_app/pjax/refresh.ts +117 -117
  158. package/source/js/_app/pjax/siteInit.ts +90 -90
  159. package/source/js/_app/player.ts +13 -13
  160. package/toolbox/compiler.mjs +49 -53
  161. package/toolbox/dev-version.mjs +14 -14
  162. package/toolbox/hoistdep.mjs +5 -5
  163. package/toolbox/lib.mjs +63 -63
  164. package/source/css/_common/components/highlight/highlight.styl +0 -357
  165. package/source/css/_common/components/highlight/operation.styl +0 -21
@@ -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
package/layout/index.pug CHANGED
@@ -1,36 +1,36 @@
1
- extends _partials/layout.pug
2
- include _mixin/card.pug
3
- include _mixin/postmeta.pug
4
- include _mixin/segment.pug
5
-
6
- block head
7
- != _css('page.css')
8
-
9
- block content
10
- div(class="index wrap")
11
- if page.current === 1
12
- if page.sticky.length > 0
13
- h2(class="divider")
14
- != __('index.sticky')
15
- - var sticky = page.sticky.toArray()
16
- div(class="segments sticky")
17
- each post in sticky
18
- +SMRender(post, false)
19
- if page.catlist.length > 0
20
- h2(class="divider")
21
- != __('index.category')
22
- div(class="cards")
23
- each cat in page.catlist
24
- +CardRender(cat)
25
- - var pagePosts = page?.posts?.length
26
- if pagePosts > 0
27
- - var posts = page.posts.toArray()
28
- if page.current === 1
29
- h2(class="divider")
30
- != __('index.posts')
31
- div(class="segments posts")
32
- each post in posts
33
- +SMRender(post, true)
34
- include _partials/pagination.pug
35
-
36
-
1
+ extends _partials/layout.pug
2
+ include _mixin/card.pug
3
+ include _mixin/postmeta.pug
4
+ include _mixin/segment.pug
5
+
6
+ block head
7
+ != _css('page.css')
8
+
9
+ block content
10
+ div(class="index wrap")
11
+ if page.current === 1
12
+ if page.sticky.length > 0
13
+ h2(class="divider")
14
+ != __('index.sticky')
15
+ - var sticky = page.sticky.toArray()
16
+ div(class="segments sticky")
17
+ each post in sticky
18
+ +SMRender(post, false)
19
+ if page.catlist.length > 0
20
+ h2(class="divider")
21
+ != __('index.category')
22
+ div(class="cards")
23
+ each cat in page.catlist
24
+ +CardRender(cat)
25
+ - var pagePosts = page?.posts?.length
26
+ if pagePosts > 0
27
+ - var posts = page.posts.toArray()
28
+ if page.current === 1
29
+ h2(class="divider")
30
+ != __('index.posts')
31
+ div(class="segments posts")
32
+ each post in posts
33
+ +SMRender(post, true)
34
+ include _partials/pagination.pug
35
+
36
+