hexo-theme-clarity 1.0.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 (71) hide show
  1. package/.travis.yml +5 -0
  2. package/LICENSE +7 -0
  3. package/README-en.md +319 -0
  4. package/README.md +343 -0
  5. package/_config.yml +180 -0
  6. package/languages/de-DE.yml +22 -0
  7. package/languages/en.yml +37 -0
  8. package/languages/es-ES.yml +22 -0
  9. package/languages/fr-FR.yml +22 -0
  10. package/languages/ko.yml +22 -0
  11. package/languages/nb-NO.yml +38 -0
  12. package/languages/ru.yml +22 -0
  13. package/languages/zh-CN.yml +38 -0
  14. package/languages/zh-TW.yml +38 -0
  15. package/layout/_partial/after_footer.pug +60 -0
  16. package/layout/_partial/comments.pug +183 -0
  17. package/layout/_partial/darkmode.pug +13 -0
  18. package/layout/_partial/footer.pug +26 -0
  19. package/layout/_partial/head.pug +61 -0
  20. package/layout/_partial/helpers.pug +21 -0
  21. package/layout/_partial/mathjax.pug +6 -0
  22. package/layout/_partial/mathjax2.pug +1 -0
  23. package/layout/_partial/paginator.pug +3 -0
  24. package/layout/_partial/post_nav.pug +6 -0
  25. package/layout/_partial/tag.pug +2 -0
  26. package/layout/_partial/totop.pug +5 -0
  27. package/layout/_partial/wordcount.pug +11 -0
  28. package/layout/_widget/category.pug +4 -0
  29. package/layout/_widget/copyright.pug +27 -0
  30. package/layout/_widget/donate.pug +19 -0
  31. package/layout/_widget/info.pug +21 -0
  32. package/layout/_widget/links.pug +6 -0
  33. package/layout/_widget/recent_comments.pug +12 -0
  34. package/layout/_widget/recent_posts.pug +4 -0
  35. package/layout/_widget/search.pug +26 -0
  36. package/layout/_widget/tag.pug +5 -0
  37. package/layout/archive.pug +24 -0
  38. package/layout/base-without-sidebar.pug +38 -0
  39. package/layout/base.pug +47 -0
  40. package/layout/blogroll.pug +21 -0
  41. package/layout/index.pug +50 -0
  42. package/layout/page.pug +12 -0
  43. package/layout/post.pug +60 -0
  44. package/layout/single-column.pug +10 -0
  45. package/layout/tagcloud.pug +23 -0
  46. package/layout/timeline.pug +28 -0
  47. package/package.json +15 -0
  48. package/source/css/copycode.scss +32 -0
  49. package/source/css/copyright.scss +43 -0
  50. package/source/css/donate.scss +308 -0
  51. package/source/css/search.scss +13 -0
  52. package/source/css/style.scss +2536 -0
  53. package/source/img/alipay.svg +1 -0
  54. package/source/img/avatar.png +0 -0
  55. package/source/img/bei.png +0 -0
  56. package/source/img/bitcoin.svg +1 -0
  57. package/source/img/github.svg +1 -0
  58. package/source/img/like.svg +1 -0
  59. package/source/img/paypal.svg +1 -0
  60. package/source/img/wechat.svg +1 -0
  61. package/source/js/codeblock-resizer.js +51 -0
  62. package/source/js/copycode.js +30 -0
  63. package/source/js/copyright.js +17 -0
  64. package/source/js/donate.js +49 -0
  65. package/source/js/fancybox.js +19 -0
  66. package/source/js/love.js +1 -0
  67. package/source/js/recent-comments.js +54 -0
  68. package/source/js/search.js +101 -0
  69. package/source/js/share.js +60 -0
  70. package/source/js/smartresize.js +32 -0
  71. package/source/js/totop.js +12 -0
@@ -0,0 +1,4 @@
1
+ .widget
2
+ .widget-title
3
+ i.fa.fa-file-o= ' ' + __('recent')
4
+ != list_posts({amount: 10})
@@ -0,0 +1,26 @@
1
+ if theme.google_search == true
2
+ .widget
3
+ form(action='//www.google.com/search' method='get' accept-charset='utf-8' class='search-form' target='_blank')
4
+ input(type='text' name='q' maxlength='20' placeholder='Search')
5
+ input(type='hidden' name='sitesearch' value=config.url)
6
+ if theme.baidu_search == true
7
+ .widget
8
+ form(action='//www.baidu.com/baidu' method='get' accept-charset='utf-8' class='search-form' target='_blank')
9
+ input(type='search' name='word' maxlength='20' placeholder='Search')
10
+ input(type='hidden' name='si' value=config.url)
11
+ input(name='tn' type='hidden' value='bds')
12
+ input(name='cl' type='hidden' value='3')
13
+ input(name='ct' type='hidden' value='2097152')
14
+ input(name='s' type='hidden' value='on')
15
+ if theme.swiftype
16
+ .widget
17
+ input.st-default-search-input(placeholder='Search' type='text')
18
+ if theme.tinysou
19
+ .widget
20
+ form
21
+ input#ts-search-input(class='ts-search-input' placeholder='Search' type='text')
22
+ if theme.self_search == true
23
+ .widget
24
+ .search-form
25
+ input#local-search-input(placeholder='Search' type='text' name='q' results='0')
26
+ #local-search-result
@@ -0,0 +1,5 @@
1
+ .widget
2
+ .widget-title
3
+ i.fa.fa-star-o= ' ' + __('tags')
4
+ .tagcloud
5
+ != tagcloud({min_font: 15, max_font: 15, amount: 100, orderby: 'count'})
@@ -0,0 +1,24 @@
1
+ extends base
2
+
3
+ block title
4
+ if page.category
5
+ title= page.category + ' | ' + config.title
6
+ if page.tag
7
+ title= page.tag + ' | ' + config.title
8
+ if page.archive
9
+ title= __('archive') + ' | ' + config.title
10
+ block content
11
+ if page.category || page.tag
12
+ h1.label-title= __('reading_label', page.category || page.tag)
13
+ .post
14
+ .post-archive
15
+ - var allposts = page.posts.toArray().reduce((r, v, i, a, k = -v.date.format('YYYY')) => ((r[k] || (r[k] = [])).push(v), r), {})
16
+ each posts, year in allposts
17
+ h2= -year
18
+ ul.listing
19
+ for post in posts
20
+ li
21
+ span.date= post.date.format(config.date_format)
22
+ a(href=url_for(post.path), title=post.title)
23
+ +title(post)
24
+ include _partial/paginator.pug
@@ -0,0 +1,38 @@
1
+ include _partial/helpers.pug
2
+
3
+ if page.title
4
+ - var current_title = page.title
5
+ else
6
+ - var current_title = config.title
7
+
8
+ if config.feed
9
+ case config.feed.type
10
+ when 'rss2'
11
+ - var feed_type='application/rss+xml'
12
+ when 'atom'
13
+ default
14
+ - var feed_type='application/atom+xml'
15
+
16
+ doctype html
17
+ html(lang=config.language)
18
+ include _partial/head.pug
19
+ body: .body_container
20
+ #header
21
+ .site-name
22
+ h1.hidden= current_title
23
+ a#logo(href=url_for('.'))= config.title
24
+ p.description= config.subtitle
25
+ nav#nav-menu
26
+ - for (var i in theme.menu)
27
+ +a_with_current(theme.menu[i].directory, __(theme.menu[i].page), theme.menu[i].icon)
28
+
29
+ #layout.pure-g
30
+ .pure-u-1.pure-u-md-4-4: .content_container
31
+ block content
32
+ .pure-u-1.pure-u-md-4-4
33
+ != partial('_partial/footer.pug')
34
+
35
+ if theme.totop == true
36
+ include _partial/totop.pug
37
+
38
+ include _partial/after_footer.pug
@@ -0,0 +1,47 @@
1
+ include _partial/helpers.pug
2
+
3
+ if page.title
4
+ - var current_title = page.title
5
+ else
6
+ - var current_title = config.title
7
+
8
+ if config.feed
9
+ case config.feed.type
10
+ when 'rss2'
11
+ - var feed_type='application/rss+xml'
12
+ when 'atom'
13
+ default
14
+ - var feed_type='application/atom+xml'
15
+
16
+ doctype html
17
+ html(lang=config.language)
18
+ include _partial/head.pug
19
+ body: .body_container
20
+ header#header
21
+ .site-name
22
+ h1.hidden= current_title
23
+ a#logo(href=url_for('.'))= config.title
24
+ p.description= config.subtitle
25
+ div#docsearch
26
+ nav#nav-menu
27
+ - for (var i in theme.menu)
28
+ +a_with_current(theme.menu[i].directory, __(theme.menu[i].page), theme.menu[i].icon)
29
+
30
+ #layout.pure-g
31
+ .pure-u-1.pure-u-md-3-4: .content_container
32
+ block content
33
+ if theme.widgets_on_small_screens
34
+ .pure-u-1.pure-u-md-1-4: aside#sidebar
35
+ each item in theme.widgets
36
+ != partial('_widget/' + item + '.pug', null, {cache: !config.relative_link})
37
+ else
38
+ .pure-u-1-4.hidden_mid_and_down: aside#sidebar
39
+ each item in theme.widgets
40
+ != partial('_widget/' + item + '.pug', null, {cache: !config.relative_link})
41
+ .pure-u-1.pure-u-md-3-4
42
+ != partial('_partial/footer.pug')
43
+
44
+ if theme.totop == true
45
+ include _partial/totop.pug
46
+
47
+ include _partial/after_footer.pug
@@ -0,0 +1,21 @@
1
+ extends base
2
+ block title
3
+ title= page.title + ' | ' + config.title
4
+ block content
5
+ .post
6
+ h1.post-title= page.title
7
+ .post-content
8
+ ul.link-items
9
+ - for (var i in theme.links)
10
+ li.link-item
11
+ a.link-url(target='_blank', href=theme.links[i].url)
12
+ .link-left
13
+ img.link-avatar(src=theme.links[i].src, title=theme.links[i].title)
14
+ .link-info
15
+ .link-blog #{theme.links[i].title}
16
+ .link-desc #{theme.links[i].desc}
17
+
18
+ if page.donate
19
+ include _widget/donate.pug
20
+ if page.comments
21
+ include _partial/comments.pug
@@ -0,0 +1,50 @@
1
+ extends base
2
+
3
+ block title
4
+ if config.subtitle
5
+ title= config.title + ' | ' + config.subtitle
6
+ else
7
+ title= config.title
8
+
9
+ block content
10
+ for post in page.posts.toArray()
11
+ .post
12
+ h1.post-title
13
+ if post.sticky
14
+ span(class="top-post")= __('Sticky')
15
+ include _partial/helpers.pug
16
+ a(href=url_for(post.path))
17
+ +title(post)
18
+ .post-meta
19
+ span.post-meta-label= '发表于'
20
+ time.post-meta-published= post.date.format(config.date_format)
21
+ if theme.disqus.enable == true
22
+ a.disqus-comment-count(data-disqus-identifier=post.path, href=url_for(post.path) + '#disqus_thread')
23
+ if theme.changyan
24
+ a.ds-thread-count(href=url_for(post.path) + '#SOHUCS')
25
+ span.cy_cmt_count(id='sourceId::' + post.date.valueOf() style='margin: 0 3px 0 1px;') 0
26
+ span= ' ' + __('Comment')
27
+ if post.description
28
+ .post-content
29
+ != post.description
30
+ else if post.excerpt
31
+ .post-content
32
+ != post.excerpt
33
+ else if post.content
34
+ - const content = strip_html(post.content)
35
+ - let expert = content.substring(0,theme.post_content_length)
36
+ - content.length > theme.post_content_length ? expert += '...' : ''
37
+ .post-content
38
+ != expert
39
+ p.readmore
40
+ a(href=url_for(post.path))= __('Readmore')
41
+
42
+ include _partial/paginator.pug
43
+ if theme.disqus.enable == true
44
+ script#dsq-count-scr(src='//'+ theme.disqus.shortname + '.disqus.com/count.js', async)
45
+ if theme.changyan
46
+ script#cy_cmt_num(src='https://changyan.sohu.com/upload/plugins/plugins.list.count.js?clientId=' + theme.changyan, async)
47
+ if config.mathjax
48
+ include _partial/mathjax.pug
49
+ if config.mathjax2
50
+ include _partial/mathjax2.pug
@@ -0,0 +1,12 @@
1
+ extends base
2
+ block title
3
+ title= page.title + ' | ' + config.title
4
+ block content
5
+ .post
6
+ h1.post-title= page.title
7
+ .post-content
8
+ != page.content
9
+ if page.donate
10
+ include _widget/donate.pug
11
+ if page.comments
12
+ include _partial/comments.pug
@@ -0,0 +1,60 @@
1
+ extends base
2
+
3
+ block title
4
+ title= page.title + ' | ' + config.title
5
+
6
+ block content
7
+ main.post
8
+ h1.post-title= page.title
9
+ .post-meta
10
+ span.post-meta-label= '发表于'
11
+ time.post-meta-published= page.date.format(config.date_format)
12
+ if page.categories.length > 0
13
+ span= ' | '
14
+ span.category
15
+ for category in page.categories.toArray()
16
+ a(href=url_for(category.path))= category.name
17
+ if theme.busuanzi == true
18
+ script(src='https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js', async)
19
+ span#busuanzi_container_page_pv= ' | '
20
+ span#busuanzi_value_page_pv
21
+ span= ' ' + __('Hits')
22
+ if theme.wordcount == true
23
+ include _partial/wordcount.pug
24
+ if theme.disqus.enable == true
25
+ a.disqus-comment-count(data-disqus-identifier=page.path, href=url_for(page.path) + '#disqus_thread')
26
+ if theme.changyan
27
+ a.ds-thread-count(href=url_for(page.path) + '#SOHUCS')
28
+ span#changyan_count_unit(style='font-size: 15px; color: #6E7173;') 0
29
+ span= ' ' + __('Comment')
30
+ script(src='https://assets.changyan.sohu.com/upload/plugins/plugins.count.js', async)
31
+ if theme.valine.enable == true
32
+ a.disqus-comment-count(href=url_for(page.path) + '#vcomment')
33
+ span.valine-comment-count(data-xid=url_for(page.path))
34
+ span= ' ' + __('Comment')
35
+ if theme.waline.enable == true
36
+ a.disqus-comment-count(href=url_for(page.path) + '#waline')
37
+ span.waline-comment-count(id=url_for(page.path))
38
+ span= ' ' + __('Comment')
39
+ if page.toc
40
+ .clear
41
+ #toc.toc-article
42
+ .toc-title= __('contents')
43
+ != toc(page.content, {list_number: theme.toc_number})
44
+ article.post-content
45
+ != page.content
46
+ if theme.donate.enable == true && page.donate != false
47
+ include _widget/donate.pug
48
+
49
+ if theme.post_copyright.enable == true && page.copyright != false
50
+ include _widget/copyright.pug
51
+
52
+ if theme.shareto == true
53
+ script(type='text/javascript', src=url_for(theme.js) + '/share.js' + '?v=' + theme.version, async)
54
+ a.article-share-link(data-url=page.permalink, data-id=page._id, data-qrcode=qrcode(page.permalink))= __('shareto')
55
+
56
+ include _partial/tag.pug
57
+ include _partial/post_nav.pug
58
+
59
+ if page.comments
60
+ include _partial/comments.pug
@@ -0,0 +1,10 @@
1
+ extends base-without-sidebar
2
+ block title
3
+ title= page.title + ' | ' + config.title
4
+ block content
5
+ .post
6
+ h1.post-title= page.title
7
+ .post-content
8
+ != page.content
9
+ if page.comments
10
+ include _partial/comments.pug
@@ -0,0 +1,23 @@
1
+ extends base
2
+ block title
3
+ title= page.title + ' | ' + config.title
4
+ block content
5
+ .post
6
+ h1.post-title= page.title
7
+ .post-content
8
+ .tagcloud
9
+ for tag in site.tags.toArray()
10
+ a(href='/tags/#' + tag.name, title=tag.name, rel= tag.length) #{tag.name}
11
+
12
+ for tag in site.tags.toArray()
13
+ .one-tag-list
14
+ span.fa.fa-tag.tag-name(id=tag.name)
15
+ span.tag-text #{tag.name}
16
+ for post in tag.posts.toArray()
17
+ .post-preview
18
+ a(href=config.root + post.path, title=post.title) #{post.title}
19
+
20
+ if page.donate
21
+ include _widget/donate.pug
22
+ if page.comments
23
+ include _partial/comments.pug
@@ -0,0 +1,28 @@
1
+ extends base
2
+ block title
3
+ title= page.title + ' | ' + config.title
4
+ block content
5
+ .post
6
+ h1.post-title= page.title
7
+ .post-content
8
+ != page.content
9
+ section#process
10
+ .container
11
+ .row
12
+ .col-xs-12.col-sm-12.col-md-8.col-md-offset-2
13
+ .timeline-centered
14
+ .line
15
+ .present Past
16
+ .dot_tp
17
+ .born Now
18
+ .dot_bt
19
+ - for (var i in theme.timeline)
20
+ .timeline-entry
21
+ .timeline-entry-inner
22
+ .timeline-icon.wow.fadeInUp(data-wow-delay='0.2s')
23
+ span.number= theme.timeline[i].num
24
+ .timeline-label.wow.fadeInUp(data-wow-delay='0.2s')
25
+ span.word= theme.timeline[i].word
26
+
27
+ if page.comments
28
+ include _partial/comments.pug
package/package.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "hexo-theme-clarity",
3
+ "version": "1.0.0",
4
+ "description": "Hexo Theme Clarity",
5
+ "keywords": [
6
+ "hexo",
7
+ "theme",
8
+ "clarity"
9
+ ],
10
+ "peerDependencies": {
11
+ "hexo-renderer-pug": "^3.0.0",
12
+ "hexo-renderer-sass-next": "^0.1.3"
13
+ },
14
+ "license": "MIT"
15
+ }
@@ -0,0 +1,32 @@
1
+ .highlight{
2
+ position: relative;
3
+ }
4
+ .btn-copy {
5
+ position: absolute;
6
+ top: 6px;
7
+ right: 6px;
8
+ display: flex;
9
+ justify-content: center;
10
+ align-items: center;
11
+ width: 32px;
12
+ height: 24px;
13
+ cursor: pointer;
14
+ border-radius: 6px;
15
+ -webkit-user-select: none;
16
+ -moz-user-select: none;
17
+ -ms-user-select: none;
18
+ user-select: none;
19
+ -webkit-appearance: none;
20
+ color: #808080;
21
+ -webkit-transition: opacity .3s ease-in-out;
22
+ -o-transition: opacity .3s ease-in-out;
23
+ transition: opacity .3s ease-in-out;
24
+ opacity: 0;
25
+ }
26
+ .btn-copy:hover{
27
+ color: #000;
28
+ }
29
+
30
+ .highlight:hover .btn-copy{
31
+ opacity: 1;
32
+ }
@@ -0,0 +1,43 @@
1
+
2
+ .post-copyright {
3
+ margin: 2em 0 0;
4
+ padding: 0.5em 1.0em;
5
+ border-left: 3px solid #FF1700;
6
+ background-color: #F9F9F9;
7
+ font-size: 0.93rem;
8
+ line-height: 1.6em;
9
+ word-break: break-all;
10
+ }
11
+ .post-copyright p{margin:0;}
12
+ .post-copyright span {
13
+ display: inline-block;
14
+ width: 5.2em;
15
+ color: #b5b5b5;
16
+ font-weight: bold;
17
+ }
18
+ .post-copyright .raw {
19
+ margin-left: 1em;
20
+ width: 5em;
21
+ }
22
+ .post-copyright a {
23
+ color: #808080;
24
+ border-bottom:0;
25
+ }
26
+ .post-copyright a:hover {
27
+ color: #a3d2a3;
28
+ text-decoration: underline;
29
+ }
30
+ .post-copyright :hover .fa-clipboard {
31
+ color: #000;
32
+ }
33
+ .post-copyright .post-url:hover {
34
+ font-weight: normal;
35
+ }
36
+ .post-copyright .copy-path {
37
+ margin-left: 1em;
38
+ width: 1em;
39
+ }
40
+ .post-copyright .copy-path:hover {
41
+ color: #808080;
42
+ cursor: pointer;
43
+ }