hexo-theme-shokax 0.0.7 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -71,4 +71,4 @@ shokaX的贡献者包括以非代码形式进行贡献的开发者(例如社区
71
71
  |:-----------|:---------------------------|
72
72
  | Lavender | https://www.lavenderdh.cn/ |
73
73
  | AdminZhang | https://www.a9-9.top/ |
74
- | D-Sketon | http://d-sketon.top/ |
74
+ | D-Sketon | https://d-sketon.top/ |
package/_config.yml CHANGED
@@ -156,6 +156,7 @@ waline:
156
156
  - mail
157
157
  wordLimit: 0 # 字数限制,0为不限制
158
158
  pageSize: 10 # 每页评论条数
159
+ pageview: true # 是否开启浏览量统计
159
160
 
160
161
  # https://github.com/gitalk/gitalk/blob/master/readme-cn.md
161
162
  gitalk:
@@ -3,7 +3,7 @@
3
3
  <id><%= config.url %></id>
4
4
  <title><%= config.title %></title>
5
5
  <subtitle><%= config.subtitle %></subtitle>
6
- <icon><%= full_url_for('/images/favicon.ico') %></icon>
6
+ <icon><%= full_url_for('/assets/favicon.ico') %></icon>
7
7
  <link href="<%= config.url %>" />
8
8
  <author>
9
9
  <name><%= config.author %></name>
@@ -2,7 +2,7 @@
2
2
  version: 'https://jsonfeed.org/version/1',
3
3
  title: config.title,
4
4
  subtitle: config.subtitle,
5
- icon: full_url_for('/images/favicon.ico'),
5
+ icon: full_url_for('/assets/favicon.ico'),
6
6
  description: config.description,
7
7
  home_page_url: config.url,
8
8
  items: posts.map(post => ({
@@ -3,7 +3,7 @@
3
3
  <channel>
4
4
  <title><%= config.title %></title>
5
5
  <subtitle><%= config.subtitle %></subtitle>
6
- <icon><%= full_url_for('/images/favicon.ico') %></icon>
6
+ <icon><%= full_url_for('/assets/favicon.ico') %></icon>
7
7
  <link><%= config.url %></link>
8
8
  <author>
9
9
  <name><%= config.author %></name>
@@ -14,20 +14,27 @@ mixin CommentRender()
14
14
  }, 1000)
15
15
  else if wl
16
16
  div(class="warp" id="wcomments")
17
+ - var locale = JSON.stringify(theme.waline.locale)
18
+ - var emoji = JSON.stringify(theme.waline.emoji)
19
+ - var meta = JSON.stringify(theme.waline.meta)
20
+ - var requiredMeta = JSON.stringify(theme.waline.requiredMeta)
17
21
  script(type="module" data-pjax).
18
22
  import { init } from 'https://unpkg.com/@waline/client@v2/dist/waline.mjs';
19
23
 
24
+ var path = document.getElementById("twikoo_visitors").getAttribute("data-path");
20
25
  setTimeout(function () {
21
26
  init({
22
27
  el: '#wcomments',
23
28
  serverURL: '#{hexo.theme.config.waline.serverURL}',
24
29
  lang: '#{hexo.theme.config.waline.lang}',
25
- locale: #{hexo.theme.config.waline.locale},
26
- emoji: #{hexo.theme.config.waline.emoji},
27
- meta: #{hexo.theme.config.waline.meta},
28
- requiredMeta: #{hexo.theme.config.waline.requiredMeta},
30
+ locale: !{locale},
31
+ emoji: !{emoji},
32
+ meta: !{meta},
33
+ requiredMeta: !{requiredMeta},
29
34
  wordLimit: #{hexo.theme.config.waline.wordLimit},
30
- pageSize: #{hexo.theme.config.waline.pageSize}
35
+ pageSize: #{hexo.theme.config.waline.pageSize},
36
+ pageview: #{theme.waline.pageview},
37
+ path: path
31
38
  });
32
39
  }, 1000)
33
40
  else if gt
@@ -2,7 +2,7 @@
2
2
  article(itemscope itemtype="http://schema.org/Article" class="post block" lang=temp)
3
3
  link(itemprop="mainEntityOfPage" href!=post.permalink)
4
4
  span(hidden itemprop="author" itemscope itemtype="http://schema.org/Person")
5
- meta(itemprop="image" content=url_for(theme.statics + theme.images + '/' + theme.sidebar.avatar))
5
+ meta(itemprop="image" content=url_for(theme.statics + theme.assets + '/' + theme.sidebar.avatar))
6
6
  meta(itemprop="name" content=author)
7
7
  meta(itemprop="description" content=`${ subtitle }, ${ description }`)
8
8
  span(hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization")
@@ -13,6 +13,6 @@ if page.reward !== false
13
13
  else
14
14
  - var translation = name
15
15
  div
16
- img(data-src=`${url_for(theme.statics + theme.images + image) }` alt=`${ author } ${ translation }`)
16
+ img(data-src=`${url_for(theme.statics + theme.assets + image) }` alt=`${ author } ${ translation }`)
17
17
  p
18
18
  != translation
@@ -30,6 +30,7 @@ block content
30
30
  - var lastcat = ""
31
31
  - var lastcatslug = ""
32
32
  else
33
+ - var lastcat = true
33
34
  mixin lastcat
34
35
  != lastcat
35
36
  a(href=url_for(cat.path))
package/layout/page.pug CHANGED
@@ -27,7 +27,6 @@ block header
27
27
  != __('title.not_found')
28
28
  else
29
29
  != page.title
30
- != "|"
31
30
 
32
31
  block content
33
32
  if page.type === 'categories'
@@ -37,6 +36,7 @@ block content
37
36
  != __('menu.home')
38
37
  small
39
38
  != _p('counter.categories', site.categories.length)
39
+ != _list_categories(3)
40
40
  else if page.type === 'tags'
41
41
  div(class="collapse wrap")
42
42
  h2(class="item title")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-shokax",
3
- "version": "0.0.7",
3
+ "version": "0.1.0",
4
4
  "description": "a hexo theme based on shoka",
5
5
  "main": "index.js",
6
6
  "repository": "https://github.com/zkz098/hexo-theme-shokaX",
@@ -38,7 +38,7 @@ hexo.extend.helper.register('_new_comments', function (mode) {
38
38
  </script>`
39
39
  } else if (mode === 'waline') {
40
40
  return `
41
- <script type="module">
41
+ <script type="module" data-pjax>
42
42
  import { RecentComments } from 'https://unpkg.com/@waline/client@v2/dist/waline.mjs'
43
43
  RecentComments({
44
44
  el: '#new-comment',
@@ -53,7 +53,7 @@ function linkGrid (args, content) {
53
53
  urlparam = new URL(item.url)
54
54
  }
55
55
 
56
- let item_image = item.image || theme.images + '/404.png'
56
+ let item_image = item.image || theme.assets + '/404.png'
57
57
 
58
58
  if (!item_image.startsWith('//') && !item_image.startsWith('http')) {
59
59
  item_image = theme.statics + item_image
@@ -8,7 +8,7 @@
8
8
  .notfound {
9
9
  width: 18.75rem;
10
10
  height: 22.625rem;
11
- background: url("../images/404.png") no-repeat center bottom;
11
+ background: url("../assets/404.png") no-repeat center bottom;
12
12
  text-align: center;
13
13
  margin: 6.25rem auto;
14
14
  }
@@ -303,7 +303,7 @@
303
303
  content: "";
304
304
  position: absolute;
305
305
  z-index: 1;
306
- background: url("../images/play_needle.png") no-repeat center/contain;
306
+ background: url("../assets/play_needle.png") no-repeat center/contain;
307
307
  width: 3.4375rem;
308
308
  height: 5.1875rem;
309
309
  top: -1.5625rem;
@@ -322,7 +322,7 @@
322
322
  &::after {
323
323
  content: "";
324
324
  position: absolute;
325
- background: url("../images/play_disc.png") no-repeat center/contain;
325
+ background: url("../assets/play_disc.png") no-repeat center/contain;
326
326
  z-index: 1;
327
327
  width: 100%;
328
328
  height: 100%;
@@ -71,7 +71,7 @@
71
71
  padding: 1.875rem 1.875rem .3125rem;
72
72
  border-radius: .3125rem;
73
73
 
74
- background: var(--grey-1-a7) url(../images/search.png) no-repeat bottom right;
74
+ background: var(--grey-1-a7) url(../assets/search.png) no-repeat bottom right;
75
75
 
76
76
  color: var(--text-color);
77
77
 
@@ -91,7 +91,7 @@
91
91
 
92
92
  .algolia-powered {
93
93
  float: right;
94
- background: url('../images/algolia_logo.svg') no-repeat;
94
+ background: url('../assets/algolia_logo.svg') no-repeat;
95
95
  display: inline-block;
96
96
  height: 1.125rem;
97
97
  width: 4.25rem;
@@ -567,7 +567,7 @@ const siteRefresh = function (reload) {
567
567
  vendorJs('copy_tex');
568
568
  vendorCss('mermaid');
569
569
  vendorJs('chart');
570
- if (!reload) {
570
+ if (reload !== 1) {
571
571
  $dom.each('script[data-pjax]', pjaxScript);
572
572
  }
573
573
  originTitle = document.title;