hexo-theme-lnote 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. package/README.md +123 -0
  2. package/_config.yml +19 -0
  3. package/config/links.yml +63 -0
  4. package/config/svg.yml +34 -0
  5. package/languages/de.yml +69 -0
  6. package/languages/en.yml +69 -0
  7. package/languages/eo.yml +69 -0
  8. package/languages/es.yml +69 -0
  9. package/languages/ja.yml +69 -0
  10. package/languages/ru.yml +69 -0
  11. package/languages/zh-CN.yml +69 -0
  12. package/languages/zh-HK.yml +69 -0
  13. package/languages/zh-TW.yml +69 -0
  14. package/layout/404.ejs +8 -0
  15. package/layout/_partials/archive-list.ejs +17 -0
  16. package/layout/_partials/category-chains.ejs +19 -0
  17. package/layout/_partials/category-list.ejs +62 -0
  18. package/layout/_partials/comments/changyan.ejs +11 -0
  19. package/layout/_partials/comments/cusdis.ejs +25 -0
  20. package/layout/_partials/comments/discuss.ejs +17 -0
  21. package/layout/_partials/comments/disqus.ejs +32 -0
  22. package/layout/_partials/comments/giscus.ejs +36 -0
  23. package/layout/_partials/comments/gitalk.ejs +19 -0
  24. package/layout/_partials/comments/livere.ejs +10 -0
  25. package/layout/_partials/comments/remark42.ejs +29 -0
  26. package/layout/_partials/comments/twikoo.ejs +25 -0
  27. package/layout/_partials/comments/utterances.ejs +27 -0
  28. package/layout/_partials/comments/valine.ejs +23 -0
  29. package/layout/_partials/comments/waline.ejs +24 -0
  30. package/layout/_partials/comments.ejs +8 -0
  31. package/layout/_partials/css.ejs +10 -0
  32. package/layout/_partials/footer/beian.ejs +33 -0
  33. package/layout/_partials/footer/statistics.ejs +39 -0
  34. package/layout/_partials/footer.ejs +7 -0
  35. package/layout/_partials/head.ejs +46 -0
  36. package/layout/_partials/header/banner.ejs +24 -0
  37. package/layout/_partials/header/navigation.ejs +57 -0
  38. package/layout/_partials/header.ejs +4 -0
  39. package/layout/_partials/markdown-plugins.ejs +24 -0
  40. package/layout/_partials/paginator.ejs +14 -0
  41. package/layout/_partials/plugins/analytics.ejs +75 -0
  42. package/layout/_partials/plugins/anchorjs.ejs +39 -0
  43. package/layout/_partials/plugins/code-widget.ejs +7 -0
  44. package/layout/_partials/plugins/encrypt.ejs +18 -0
  45. package/layout/_partials/plugins/fancybox.ejs +11 -0
  46. package/layout/_partials/plugins/highlight.ejs +13 -0
  47. package/layout/_partials/plugins/math.ejs +51 -0
  48. package/layout/_partials/plugins/mermaid.ejs +4 -0
  49. package/layout/_partials/plugins/nprogress.ejs +8 -0
  50. package/layout/_partials/plugins/typed.ejs +20 -0
  51. package/layout/_partials/post/category-bar.ejs +18 -0
  52. package/layout/_partials/post/copyright.ejs +50 -0
  53. package/layout/_partials/post/css.ejs +4 -0
  54. package/layout/_partials/post/meta-bottom.ejs +16 -0
  55. package/layout/_partials/post/meta-top.ejs +28 -0
  56. package/layout/_partials/post/scripts.ejs +8 -0
  57. package/layout/_partials/post/sidebar-left.ejs +1 -0
  58. package/layout/_partials/post/sidebar-right.ejs +3 -0
  59. package/layout/_partials/post/toc.ejs +7 -0
  60. package/layout/_partials/scripts.ejs +10 -0
  61. package/layout/_partials/search.ejs +19 -0
  62. package/layout/about.ejs +22 -0
  63. package/layout/archive.ejs +10 -0
  64. package/layout/categories.ejs +20 -0
  65. package/layout/category.ejs +12 -0
  66. package/layout/index.ejs +61 -0
  67. package/layout/layout.ejs +60 -0
  68. package/layout/links.ejs +31 -0
  69. package/layout/page.ejs +15 -0
  70. package/layout/post.ejs +77 -0
  71. package/layout/tag.ejs +12 -0
  72. package/layout/tags.ejs +26 -0
  73. package/package.json +70 -0
  74. package/scripts/index.js +1 -0
  75. package/source/css/_functions/base.styl +8 -0
  76. package/source/css/_mixins/base.styl +23 -0
  77. package/source/css/_pages/_about/about.styl +32 -0
  78. package/source/css/_pages/_archive/archive.styl +32 -0
  79. package/source/css/_pages/_base/_widget/anchorjs.styl +8 -0
  80. package/source/css/_pages/_base/_widget/banner.styl +29 -0
  81. package/source/css/_pages/_base/_widget/board.styl +11 -0
  82. package/source/css/_pages/_base/_widget/code-widget.styl +36 -0
  83. package/source/css/_pages/_base/_widget/copyright.styl +90 -0
  84. package/source/css/_pages/_base/_widget/footer.styl +65 -0
  85. package/source/css/_pages/_base/_widget/footnote.styl +25 -0
  86. package/source/css/_pages/_base/_widget/header.styl +173 -0
  87. package/source/css/_pages/_base/_widget/modal.styl +100 -0
  88. package/source/css/_pages/_base/_widget/navlink.styl +16 -0
  89. package/source/css/_pages/_base/_widget/ngrogress.styl +12 -0
  90. package/source/css/_pages/_base/_widget/noscript.styl +12 -0
  91. package/source/css/_pages/_base/_widget/pagination.styl +23 -0
  92. package/source/css/_pages/_base/_widget/qrcode.styl +17 -0
  93. package/source/css/_pages/_base/_widget/scroll-btn.styl +48 -0
  94. package/source/css/_pages/_base/_widget/text.styl +19 -0
  95. package/source/css/_pages/_base/_widget/toc.styl +75 -0
  96. package/source/css/_pages/_base/base.styl +68 -0
  97. package/source/css/_pages/_base/color-schema.styl +75 -0
  98. package/source/css/_pages/_base/inline.styl +51 -0
  99. package/source/css/_pages/_base/keyframes.styl +31 -0
  100. package/source/css/_pages/_base/print.styl +38 -0
  101. package/source/css/_pages/_category/category-bar.styl +58 -0
  102. package/source/css/_pages/_category/category-chain.styl +6 -0
  103. package/source/css/_pages/_category/category-list.styl +62 -0
  104. package/source/css/_pages/_index/index.styl +75 -0
  105. package/source/css/_pages/_links/links.styl +79 -0
  106. package/source/css/_pages/_post/comment.styl +27 -0
  107. package/source/css/_pages/_post/highlight.styl +75 -0
  108. package/source/css/_pages/_post/markdown.styl +96 -0
  109. package/source/css/_pages/_post/post-page.styl +179 -0
  110. package/source/css/_pages/_post/post-tag.styl +29 -0
  111. package/source/css/_pages/_tag/tag.styl +9 -0
  112. package/source/css/_pages/_tag/tags.styl +9 -0
  113. package/source/css/_pages/pages.styl +8 -0
  114. package/source/css/_variables/base.styl +72 -0
  115. package/source/css/gitalk.css +546 -0
  116. package/source/css/main.styl +19 -0
  117. package/source/img/avatar.png +0 -0
  118. package/source/img/default.jpg +0 -0
  119. package/source/img/default1.jpg +0 -0
  120. package/source/img/default2.jpg +0 -0
  121. package/source/img/default3.jpg +0 -0
  122. package/source/img/default4.jpg +0 -0
  123. package/source/img/default5.jpg +0 -0
  124. package/source/img/default6.jpg +0 -0
  125. package/source/img/default7.jpg +0 -0
  126. package/source/img/default8.jpg +0 -0
  127. package/source/img/docs.png +0 -0
  128. package/source/img/loading.gif +0 -0
  129. package/source/img/police_beian.png +0 -0
  130. package/source/js/color-schema.js +279 -0
  131. package/source/js/events.js +72 -0
  132. package/source/js/img-lazyload.js +10 -0
  133. package/source/js/local-search.js +70 -0
  134. package/source/js/post/copying-code.js +34 -0
  135. package/source/js/post/enable.js +8 -0
  136. package/source/js/post/img-swipe-bf.js +47 -0
  137. package/source/js/post/img-swipe.js +35 -0
  138. package/source/js/post/mermaiding.js +13 -0
  139. package/source/js/post/play-imgs.js +59 -0
  140. package/source/js/post/toc.js +24 -0
  141. package/source/js/post/view-imgs.js +27 -0
  142. package/source/js/utils.js +245 -0
  143. package/source/xml/local-search.xml +45 -0
  144. package/templates/footer.ejs +13 -0
  145. package/templates/noun.vue +18 -0
@@ -0,0 +1,33 @@
1
+ <div class="beian">
2
+ <span>
3
+ <a href="http://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener">
4
+ <%- theme.footer.beian.icp_text %>
5
+ </a>
6
+ </span>
7
+ <% if(theme.footer.beian.police_text) { %>
8
+ <% if(theme.footer.beian.police_code) { %>
9
+ <span>
10
+ <a
11
+ href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=<%= theme.footer.beian.police_code %>"
12
+ rel="nofollow noopener"
13
+ class="beian-police"
14
+ target="_blank"
15
+ >
16
+ <% if(theme.footer.beian.police_icon) { %>
17
+ <span style="visibility: hidden; width: 0">|</span>
18
+ <img src="<%= url_for(theme.footer.beian.police_icon) %>" alt="police-icon"/>
19
+ <% } %>
20
+ <span><%- theme.footer.beian.police_text %></span>
21
+ </a>
22
+ </span>
23
+ <% } else { %>
24
+ <span class="beian-police">
25
+ <% if(theme.footer.beian.police_icon) { %>
26
+ <span style="visibility: hidden; width: 0">|</span>
27
+ <img src="<%= url_for(theme.footer.beian.police_icon) %>" alt="police-icon"/>
28
+ <% } %>
29
+ <span class="beian-police"><%- theme.footer.beian.police_text %></span>
30
+ </span>
31
+ <% } %>
32
+ <% } %>
33
+ </div>
@@ -0,0 +1,39 @@
1
+ <div class="statistics">
2
+ <% var pv_texts = (theme.footer.statistics.pv_format || __('footer.pv')).split('{}') %>
3
+ <% var uv_texts = (theme.footer.statistics.uv_format || __('footer.uv')).split('{}') %>
4
+
5
+ <% if (theme.footer.statistics.source === 'leancloud') { %>
6
+ <% if (pv_texts.length >= 2) { %>
7
+ <span id="leancloud-site-pv-container" style="display: none">
8
+ <%- pv_texts[0] %>
9
+ <span id="leancloud-site-pv"></span>
10
+ <%- pv_texts[1] %>
11
+ </span>
12
+ <% } %>
13
+ <% if (uv_texts.length >= 2) { %>
14
+ <span id="leancloud-site-uv-container" style="display: none">
15
+ <%- uv_texts[0] %>
16
+ <span id="leancloud-site-uv"></span>
17
+ <%- uv_texts[1] %>
18
+ </span>
19
+ <% } %>
20
+ <% import_js(theme.static_prefix.internal_js, 'leancloud.js', 'defer') %>
21
+
22
+ <% } else if (theme.footer.statistics.source === 'busuanzi') { %>
23
+ <% if (pv_texts.length >= 2) { %>
24
+ <span id="busuanzi_container_site_pv" style="display: none">
25
+ <%- pv_texts[0] %>
26
+ <span id="busuanzi_value_site_pv"></span>
27
+ <%- pv_texts[1] %>
28
+ </span>
29
+ <% } %>
30
+ <% if (uv_texts.length >= 2) { %>
31
+ <span id="busuanzi_container_site_uv" style="display: none">
32
+ <%- uv_texts[0] %>
33
+ <span id="busuanzi_value_site_uv"></span>
34
+ <%- uv_texts[1] %>
35
+ </span>
36
+ <% } %>
37
+ <% import_js(theme.static_prefix.busuanzi, theme.static_prefix.busuanzi, 'defer') %>
38
+ <% } %>
39
+ </div>
@@ -0,0 +1,7 @@
1
+ <div class="footer-inner">
2
+ <% if (theme.footer.content) { %>
3
+ <div class="footer-content">
4
+ <%- theme.footer.content %>
5
+ </div>
6
+ <% } %>
7
+ </div>
@@ -0,0 +1,46 @@
1
+ <%
2
+ var separator = ' - '
3
+ var title = page.title ? [page.title, config.title].join(separator) : config.title
4
+ var keywords = page.keywords || config.keywords
5
+ if (keywords instanceof Array) {
6
+ keywords = keywords.join(',')
7
+ }
8
+ var description = page.description || page.excerpt || (is_post() && page.content) || config.description
9
+ if (description) {
10
+ description = strip_html(description).substring(0, 200).trim().replace(/\n/g, ' ')
11
+ }
12
+ var ogImage = page.og_img || page.index_img
13
+ var ogConfig = Object.assign({ image: ogImage && url_for(ogImage) }, theme.open_graph)
14
+ %>
15
+
16
+ <head>
17
+ <meta charset="UTF-8">
18
+ <link rel="apple-touch-icon" sizes="76x76" href="<%= url_for(theme.apple_touch_icon) %>">
19
+ <link rel="icon" href="<%= url_for(theme.favicon) %>">
20
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
21
+ <meta http-equiv="x-ua-compatible" content="ie=edge">
22
+ <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
23
+ <meta name="theme-color" content="#000">
24
+ <meta name="author" content="<%= config.author %>">
25
+ <meta name="keywords" content="<%= keywords %>">
26
+ <%- open_graph(ogConfig) %>
27
+ <meta name="description" content="<%= description %>">
28
+ <meta name="referrer" content="no-referrer-when-downgrade">
29
+
30
+ <% if(!theme.html_cache_enable) { %>
31
+ <meta http-equiv="Cache-Control" content="no-cache,no-store,must-revalidate">
32
+ <meta http-equiv="Pragma" content="no-cache">
33
+ <meta http-equiv="Expires" content="0">
34
+ <% } %>
35
+
36
+ <title><%= title %></title>
37
+
38
+ <%- partial('_partials/css.ejs') %>
39
+ <%- export_config() %>
40
+
41
+
42
+ <script src="<%= url_for('js/utils.js') %>"></script>
43
+ <script src="<%= url_for('js/color-schema.js') %>"></script>
44
+
45
+ <%- inject_point('head') %>
46
+ </head>
@@ -0,0 +1,24 @@
1
+ <%
2
+ var banner_img = page.banner_img || theme.banner_img
3
+ var subtitle = page.subtitle || page.title
4
+ %>
5
+
6
+ <div id="banner" class="banner" parallax=true
7
+ style="background: url('<%- url_for(banner_img) %>') no-repeat center center; background-size: cover;">
8
+ <div class="full-bg-img">
9
+ <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
10
+ <div class="banner-text text-center fade-in-up">
11
+ <div class="h2">
12
+ <span id="subtitle" data-typed-text="<%= subtitle %>"></span>
13
+ </div>
14
+
15
+ <% if (is_post()) { %>
16
+ <%- inject_point('postMetaTop') %>
17
+ <% } %>
18
+ </div>
19
+ <% if(!is_post()) { %>
20
+ <div class="scroll-down-bar"><i class="iconfont icon-arrowdown"></i></div>
21
+ <% } %>
22
+ </div>
23
+ </div>
24
+ </div>
@@ -0,0 +1,57 @@
1
+ <nav id="navbar" class="navbar fixed-top navbar-expand-lg navbar-dark scrolling-navbar">
2
+ <div class="container">
3
+ <a class="navbar-brand" href="<%= url_for() %>">
4
+ <strong><%= config.title %></strong>
5
+ </a>
6
+
7
+ <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
8
+ <div class="animated-icon"><span></span><span></span><span></span></div>
9
+ </button>
10
+
11
+ <!-- Collapsible content -->
12
+ <div class="collapse navbar-collapse" id="navbarSupportedContent" style="flex-grow: 0;">
13
+ <ul class="navbar-nav ml-auto text-center">
14
+ <li class="nav-item">
15
+ <a class="nav-link" href="<%= url_for() %>">
16
+ <i class="iconfont icon-home-fill"></i>
17
+ <span><%= __('home.menu') %></span>
18
+ </a>
19
+ </li>
20
+ <li class="nav-item">
21
+ <a class="nav-link" href="<%= url_for('/archives') %>">
22
+ <i class="iconfont icon-archive-fill"></i>
23
+ <span><%= __('archive.menu') %></span>
24
+ </a>
25
+ </li>
26
+ <li class="nav-item">
27
+ <a class="nav-link" href="<%= url_for('/categories') %>">
28
+ <i class="iconfont icon-category-fill"></i>
29
+ <span><%= __('category.menu') %></span>
30
+ </a>
31
+ </li>
32
+ <li class="nav-item">
33
+ <a class="nav-link" href="<%= url_for('/tags') %>">
34
+ <i class="iconfont icon-tags-fill"></i>
35
+ <span><%= __('tag.menu') %></span>
36
+ </a>
37
+ </li>
38
+ <li class="nav-item">
39
+ <a class="nav-link" href="<%= url_for('/about') %>">
40
+ <i class="iconfont icon-user-fill"></i>
41
+ <span><%= __('about.menu') %></span>
42
+ </a>
43
+ </li>
44
+ <li class="nav-item" id="search-btn">
45
+ <a class="nav-link" target="_self" href="javascript:;" data-bs-toggle="modal" data-bs-target="#modalSearch" aria-label="Search">
46
+ <i class="iconfont icon-search"></i>
47
+ </a>
48
+ </li>
49
+ <li class="nav-item" id="color-toggle-btn">
50
+ <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">
51
+ <i class="iconfont icon-dark" id="color-toggle-icon"></i>
52
+ </a>
53
+ </li>
54
+ </ul>
55
+ </div>
56
+ </div>
57
+ </nav>
@@ -0,0 +1,4 @@
1
+ <div class="header-inner" style="height: 70vh;">
2
+ <%- partial('_partials/header/navigation') %>
3
+ <%- partial('_partials/header/banner') %>
4
+ </div>
@@ -0,0 +1,24 @@
1
+ <%# import_css(theme.static_prefix.github_markdown, 'github-markdown.min.css') %>
2
+ <%# import_css(theme.static_prefix.hint, 'hint.min.css') %>
3
+
4
+ <% if (theme.code.highlight.enable) { %>
5
+ <%- partial('_partials/plugins/highlight.ejs') %>
6
+ <% } %>
7
+ <% if ((theme.code.language.enable && theme.code.language.default) || theme.code.copy_btn) { %>
8
+ <%- partial('_partials/plugins/code-widget.ejs') %>
9
+ <% } %>
10
+ <% if (theme.fun_features.anchorjs.enable && page.anchorjs !== false) { %>
11
+ <%- partial('_partials/plugins/anchorjs.ejs') %>
12
+ <% } %>
13
+ <% if (theme.post.image_zoom.enable && page.image_zoom !== false) { %>
14
+ <%- partial('_partials/plugins/fancybox.ejs') %>
15
+ <% } %>
16
+ <% if (theme.post.image_caption.enable) { %>
17
+ <% import_script('<script>LNote.plugins.imageCaption();</script>') %>
18
+ <% } %>
19
+ <% if (theme.post.math.enable && (!theme.post.math.specific || (theme.post.math.specific && page.math))) { %>
20
+ <%- partial('_partials/plugins/math.ejs') %>
21
+ <% } %>
22
+ <% if (theme.post.mermaid.enable && (!theme.post.mermaid.specific || (theme.post.mermaid.specific && page.mermaid))) { %>
23
+ <%- partial('_partials/plugins/mermaid.ejs') %>
24
+ <% } %>
@@ -0,0 +1,14 @@
1
+ <% if (page.total > 1){ %>
2
+ <nav aria-label="navigation">
3
+ <span class="pagination" id="pagination">
4
+ <%- paginator({
5
+ prev_text: '<i class="iconfont icon-arrowleft"></i>',
6
+ next_text: '<i class="iconfont icon-arrowright"></i>',
7
+ mid_size: 2,
8
+ end_size: 1,
9
+ format: `${config.pagination_dir}/%d`,
10
+ escape: false
11
+ }) %>
12
+ </span>
13
+ </nav>
14
+ <% } %>
@@ -0,0 +1,75 @@
1
+ <% if (theme.web_analytics.enable) { %>
2
+
3
+ <% if(theme.web_analytics.baidu) { %>
4
+ <!-- Baidu Analytics -->
5
+ <script async>
6
+ if (!LNote.ctx.dnt) {
7
+ var _hmt = _hmt || [];
8
+ (function() {
9
+ var hm = document.createElement("script");
10
+ hm.src = "https://hm.baidu.com/hm.js?<%= theme.web_analytics.baidu %>";
11
+ var s = document.getElementsByTagName("script")[0];
12
+ s.parentNode.insertBefore(hm, s);
13
+ })();
14
+ }
15
+ </script>
16
+ <% } %>
17
+
18
+ <% if (theme.web_analytics.google){ %>
19
+ <!-- Google tag (gtag.js) -->
20
+ <script async>
21
+ if (!LNote.ctx.dnt) {
22
+ LNote.utils.createScript("https://www.googletagmanager.com/gtag/js?id=<%= theme.web_analytics.google.measurement_id %>", function() {
23
+ window.dataLayer = window.dataLayer || [];
24
+ function gtag() {
25
+ dataLayer.push(arguments);
26
+ }
27
+ gtag('js', new Date());
28
+ gtag('config', '<%- theme.web_analytics.google.measurement_id %>');
29
+ });
30
+ }
31
+ </script>
32
+ <% } %>
33
+
34
+ <% if(theme.web_analytics.tencent && theme.web_analytics.tencent.sid && theme.web_analytics.tencent.cid) { %>
35
+ <!-- Tencent Analytics -->
36
+ <script async>
37
+ if (!LNote.ctx.dnt) {
38
+ var _mtac = {};
39
+ (function() {
40
+ var mta = document.createElement("script");
41
+ mta.src = "//pingjs.qq.com/h5/stats.js?v2.0.4";
42
+ mta.setAttribute("name", "MTAH5");
43
+ mta.setAttribute("sid", "<%= theme.web_analytics.tencent.sid %>");
44
+ <% if(theme.web_analytics.tencent.cid) { %>
45
+ mta.setAttribute("cid", "<%= theme.web_analytics.tencent.cid %>");
46
+ <% } %>
47
+ var s = document.getElementsByTagName("script")[0];
48
+ s.parentNode.insertBefore(mta, s);
49
+ })();
50
+ }
51
+ </script>
52
+ <% } %>
53
+
54
+ <% if(theme.web_analytics.woyaola) { %>
55
+ <!-- 51.la Analytics -->
56
+ <script async>
57
+ if (!LNote.ctx.dnt) {
58
+ LNote.utils.createScript('//js.users.51.la/<%= theme.web_analytics.woyaola %>.js');
59
+ }
60
+ </script>
61
+ <% } %>
62
+
63
+ <% if(theme.web_analytics.cnzz) { %>
64
+ <!-- cnzz Analytics -->
65
+ <script async>
66
+ if (!LNote.ctx.dnt) {
67
+ LNote.utils.createScript('//s4.cnzz.com/z_stat.php?id=<%= theme.web_analytics.cnzz %>&show=pic');
68
+ }
69
+ </script>
70
+ <% } %>
71
+
72
+ <% if(theme.web_analytics.leancloud && theme.web_analytics.leancloud.app_id && theme.web_analytics.leancloud.app_key) { %>
73
+ <% import_js(theme.static_prefix.internal_js, 'leancloud.js', 'defer') %>
74
+ <% } %>
75
+ <% } %>
@@ -0,0 +1,39 @@
1
+ <%
2
+ import_script(`
3
+ <script>
4
+ LNote.utils.createScript('${ url_join(theme.static_prefix.anchor, 'anchor.min.js') }', function() {
5
+ window.anchors.options = {
6
+ placement: CONFIG.anchorjs.placement,
7
+ visible : CONFIG.anchorjs.visible
8
+ };
9
+ if (CONFIG.anchorjs.icon) {
10
+ window.anchors.options.icon = CONFIG.anchorjs.icon;
11
+ }
12
+ var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
13
+ var res = [];
14
+ for (var item of el) {
15
+ res.push('.markdown-body > ' + item.trim());
16
+ }
17
+ if (CONFIG.anchorjs.placement === 'left') {
18
+ window.anchors.options.class = 'anchorjs-link-left';
19
+ }
20
+ window.anchors.add(res.join(', '));
21
+
22
+ LNote.events.registerRefreshCallback(function() {
23
+ if ('anchors' in window) {
24
+ anchors.removeAll();
25
+ var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
26
+ var res = [];
27
+ for (var item of el) {
28
+ res.push('.markdown-body > ' + item.trim());
29
+ }
30
+ if (CONFIG.anchorjs.placement === 'left') {
31
+ anchors.options.class = 'anchorjs-link-left';
32
+ }
33
+ anchors.add(res.join(', '));
34
+ }
35
+ });
36
+ });
37
+ </script>
38
+ `)
39
+ %>
@@ -0,0 +1,7 @@
1
+ <%
2
+ if (theme.code.copy_btn) {
3
+ import_script(`<script src=${url_join(theme.static_prefix.clipboard, 'clipboard.min.js')}></script>`)
4
+ }
5
+ import_script(`<script>LNote.plugins.codeWidget();</script>
6
+ `)
7
+ %>
@@ -0,0 +1,18 @@
1
+ <%
2
+ import_script(`
3
+ <script defer>
4
+ if (document.getElementById('hbePass') || document.querySelector('hbe-prefix')) {
5
+ LNote.utils.waitElementLoaded('hbe-prefix', function() {
6
+ var hbePrefix = document.querySelector('hbe-prefix');
7
+ hbePrefix.parentElement.classList.add('markdown-body');
8
+ LNote.utils.retry(function() {
9
+ if (LNote.boot && LNote.boot.refresh) {
10
+ LNote.boot.refresh();
11
+ return true;
12
+ }
13
+ }, 100, 10);
14
+ })
15
+ }
16
+ </script>
17
+ `)
18
+ %>
@@ -0,0 +1,11 @@
1
+ <%
2
+ import_css(theme.static_prefix.fancybox, 'jquery.fancybox.min.css')
3
+
4
+ import_script(`
5
+ <script>
6
+ LNote.utils.createScript('${url_join(theme.static_prefix.fancybox, 'jquery.fancybox.min.js')}', function() {
7
+ LNote.plugins.fancyBox();
8
+ });
9
+ </script>
10
+ `)
11
+ %>
@@ -0,0 +1,13 @@
1
+ <%
2
+ if (theme.code.highlight.lib === 'prismjs') {
3
+ if (!theme.code.highlight.prismjs.preprocess) {
4
+ import_js(theme.static_prefix.prismjs, 'components/prism-core.min.js')
5
+ import_js(theme.static_prefix.prismjs, 'plugins/autoloader/prism-autoloader.min.js')
6
+ }
7
+
8
+ if (theme.code.highlight.line_number) {
9
+ import_css(theme.static_prefix.prismjs, '/plugins/line-numbers/prism-line-numbers.min.css')
10
+ import_js(theme.static_prefix.prismjs, '/plugins/line-numbers/prism-line-numbers.min.js')
11
+ }
12
+ }
13
+ %>
@@ -0,0 +1,51 @@
1
+ <% if(theme.post.math.engine === 'mathjax') { %>
2
+ <%
3
+ var lazy = theme.lazyload.enable && require_version(theme.static_prefix.mathjax, '3.2.0')
4
+
5
+ import_script(`
6
+ <script>
7
+ if (!window.MathJax) {
8
+ window.MathJax = {
9
+ tex : {
10
+ inlineMath: { '[+]': [['$', '$']] }
11
+ },
12
+ loader : {
13
+ ${ lazy ? 'load: \[\'ui/lazy\'\]' : '' }
14
+ },
15
+ options: {
16
+ renderActions: {
17
+ insertedScript: [200, () => {
18
+ document.querySelectorAll('mjx-container').forEach(node => {
19
+ let target = node.parentNode;
20
+ if (target.nodeName.toLowerCase() === 'li') {
21
+ target.parentNode.classList.add('has-jax');
22
+ }
23
+ });
24
+ }, '', false]
25
+ }
26
+ }
27
+ };
28
+ } else {
29
+ MathJax.startup.document.state(0);
30
+ MathJax.texReset();
31
+ MathJax.typeset();
32
+ MathJax.typesetPromise();
33
+ }
34
+
35
+ LNote.events.registerRefreshCallback(function() {
36
+ if ('MathJax' in window && MathJax.startup.document && typeof MathJax.startup.document.state === 'function') {
37
+ MathJax.startup.document.state(0);
38
+ MathJax.texReset();
39
+ MathJax.typeset();
40
+ MathJax.typesetPromise();
41
+ }
42
+ });
43
+ </script>
44
+ `)
45
+
46
+ import_js(theme.static_prefix.mathjax.replace('es5/', ''), 'es5/tex-mml-chtml.js')
47
+ %>
48
+
49
+ <% } else if (theme.post.math.engine === 'katex') { %>
50
+ <% import_css(theme.static_prefix.katex, 'katex.min.css') %>
51
+ <% } %>
@@ -0,0 +1,4 @@
1
+ <% if (page.mermaid) { %>
2
+ <%- post_html_link('mermaid') %>
3
+ <% } %>
4
+
@@ -0,0 +1,8 @@
1
+ <%- post_html_link('nprogress') %>
2
+ <script>
3
+ NProgress.configure({showSpinner: false, trickleSpeed: 100})
4
+ NProgress.start()
5
+ window.addEventListener('load', function() {
6
+ NProgress.done();
7
+ })
8
+ </script>
@@ -0,0 +1,20 @@
1
+ <script>
2
+ (function (window, document) {
3
+ const subtitle = document.getElementById('subtitle');
4
+ if (!subtitle || !('Typed' in window)) {
5
+ return;
6
+ }
7
+ subtitle.innerText = '';
8
+
9
+ const text = subtitle.getAttribute('data-typed-text');
10
+ const typed = new window.Typed('#subtitle', {
11
+ strings: [
12
+ ' ',
13
+ text
14
+ ],
15
+ cursorChar: '_',
16
+ typeSpeed: 80,
17
+ loop: false
18
+ });
19
+ })(window, document);
20
+ </script>
@@ -0,0 +1,18 @@
1
+ <%
2
+ var parent = page.categories.filter(c => !c.parent)
3
+ if (Array.isArray(page.category_bar)) {
4
+ parent = page.categories.filter(cat => page.category_bar.indexOf(cat.name) !== -1)
5
+ }
6
+ var filterIds = page.categories.map(c => c._id)
7
+ filterIds.push(page._id)
8
+ %>
9
+
10
+ <%- partial('_partials/category-list', {
11
+ curCats : parent,
12
+ params: {
13
+ type : 'post',
14
+ filterIds: filterIds,
15
+ postLimit: 10,
16
+ postOrderBy: '-date'
17
+ }
18
+ }) %>
@@ -0,0 +1,50 @@
1
+ <%
2
+ var license = 'BY'
3
+ if (typeof page.copyright === 'string') {
4
+ license = page.copyright
5
+ } else if (typeof page.license === 'string') {
6
+ license = page.license
7
+ }
8
+ license = license.toUpperCase()
9
+ %>
10
+
11
+ <div class="license-box my-3">
12
+ <div class="license-title">
13
+ <div><%= page.title %></div>
14
+ <div><%= decode_url(page.permalink) %></div>
15
+ </div>
16
+ <div class="license-meta">
17
+ <div class="license-meta-item">
18
+ <div><%- __('post.copyright.author') %></div>
19
+ <div><%- page.author || config.author %></div>
20
+ </div>
21
+ <div class="license-meta-item license-meta-date">
22
+ <div><%- __('post.copyright.posted') %></div>
23
+ <div><%= full_date(page.date, 'LL') %></div>
24
+ </div>
25
+ <div class="license-meta-item license-meta-date">
26
+ <div><%- __('post.copyright.updated') %></div>
27
+ <div><%= full_date(page.updated, 'LL') %></div>
28
+ </div>
29
+ <% if (license) { %>
30
+ <div class="license-meta-item">
31
+ <div><%- __('post.copyright.licensed') %></div>
32
+ <div>
33
+ <% if (['BY', 'BY-SA', 'BY-ND', 'BY-NC', 'BY-NC-SA', 'BY-NC-ND'].indexOf(license) !== -1) { %>
34
+ <% var items = license.split('-') %>
35
+ <% for (var idx = 0; idx < items.length; idx++) { %>
36
+ <a class="print-no-link" target="_blank" href="https://creativecommons.org/licenses/<%= license.toLowerCase() %>/4.0/">
37
+ <span class="hint--top hint--rounded" aria-label="<%- __('post.copyright.' + items[idx]) %>">
38
+ <i class="iconfont icon-<%= items[idx].toLowerCase() %>"></i>
39
+ </span>
40
+ </a>
41
+ <% } %>
42
+ <% } else { %>
43
+ <%- license %>
44
+ <% } %>
45
+ </div>
46
+ </div>
47
+ <% } %>
48
+ </div>
49
+ <div class="license-icon iconfont"></div>
50
+ </div>
@@ -0,0 +1,4 @@
1
+ <% if(is_post()) { %>
2
+ <link id="highlight-css" rel="stylesheet" href="//lib.baomitu.com/highlight.js/11.9.0/styles/qtcreator-light.min.css">
3
+ <link id="highlight-css-dark" rel="stylesheet" href="//lib.baomitu.com/highlight.js/11.9.0/styles/qtcreator-dark.min.css">
4
+ <% } %>
@@ -0,0 +1,16 @@
1
+ <div class="post-metas my-3">
2
+ <% if (page.categories && page.categories.length > 0) { %>
3
+ <div class="post-meta mr-3 d-flex align-items-center">
4
+ <i class="iconfont icon-category"></i>
5
+ <%- partial('_partials/category-chains', { categories: page.categories }) %>
6
+ </div>
7
+ <% } %>
8
+ <% if (page.tags && page.tags.length > 0 ) { %>
9
+ <div class="post-meta">
10
+ <i class="iconfont icon-tags"></i>
11
+ <% page.tags.each(function(tag) { %>
12
+ <a href="<%= url_for(tag.path) %>" class="print-no-link">#<%- tag.name %></a>
13
+ <% }) %>
14
+ </div>
15
+ <% } %>
16
+ </div>
@@ -0,0 +1,28 @@
1
+ <div class="mt-3">
2
+ <span class="post-meta">
3
+ <i class="iconfont icon-date-fill" aria-hidden="true"></i>
4
+ <time datetime="<%= full_date(page.date, 'YYYY-MM-DD HH:mm') %>" pubdate>
5
+ <%= full_date(page.date, 'LLLL') %>
6
+ </time>
7
+ </span>
8
+ </div>
9
+
10
+ <div class="mt-1">
11
+ <span class="post-meta mr-2">
12
+ <i class="iconfont icon-chart"></i>
13
+ <%- __('post.meta.wordcount', wordcount(page)) %>
14
+ </span>
15
+
16
+ <span class="post-meta mr-2">
17
+ <i class="iconfont icon-clock-fill"></i>
18
+ <% var awl = parseInt(2, 10) %>
19
+ <% var wpm = parseInt(60, 10) %>
20
+ <%- __('post.meta.min2read', min2read(page, { awl: awl, wpm: wpm })) %>
21
+ </span>
22
+
23
+ <span id="busuanzi_container_page_pv" style="display: none">
24
+ <i class="iconfont icon-eye" aria-hidden="true"></i>
25
+ <span id="busuanzi_value_site_pv"></span>
26
+ <%- __('post.meta.views') %>
27
+ </span>
28
+ </div>
@@ -0,0 +1,8 @@
1
+ <% if(is_post()) { %>
2
+ <%- post_html_link('tocbot') %>
3
+ <%- post_html_link('clipboard') %>
4
+ <%- post_html_link('photoswipe') %>
5
+ <%- post_html_link('enable') %>
6
+ <script crossorigin="anonymous" integrity="sha512-G2PbtRp8Sjlvy8e+LxaLxtcpLfMtZTCgnpyHwc17gbFoMrhxdcFmUmuAmv9KWNTVaYOqXq6pPqCebgxcMYnCEw==" src="//lib.baomitu.com/busuanzi/2.3.0/bsz.pure.mini.min.js" defer></script>
7
+ <%- partial('_partials/plugins/mermaid.ejs') %>
8
+ <% } %>