hexo-theme-lnote 1.2.4 → 1.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. package/README.md +122 -122
  2. package/_config.yml +19 -19
  3. package/config/links.yml +63 -63
  4. package/config/svg.yml +33 -33
  5. package/index.d.ts +4 -0
  6. package/languages/de.yml +69 -69
  7. package/languages/en.yml +73 -69
  8. package/languages/eo.yml +69 -69
  9. package/languages/es.yml +69 -69
  10. package/languages/ja.yml +69 -69
  11. package/languages/ru.yml +69 -69
  12. package/languages/zh-CN.yml +73 -69
  13. package/languages/zh-HK.yml +73 -69
  14. package/languages/zh-TW.yml +73 -69
  15. package/layout/404.ejs +8 -8
  16. package/layout/_partials/archive-list.ejs +17 -17
  17. package/layout/_partials/category-chains.ejs +19 -19
  18. package/layout/_partials/category-list.ejs +62 -62
  19. package/layout/_partials/comments/changyan.ejs +11 -11
  20. package/layout/_partials/comments/cusdis.ejs +25 -25
  21. package/layout/_partials/comments/discuss.ejs +17 -17
  22. package/layout/_partials/comments/disqus.ejs +32 -32
  23. package/layout/_partials/comments/giscus.ejs +36 -36
  24. package/layout/_partials/comments/gitalk.ejs +19 -19
  25. package/layout/_partials/comments/livere.ejs +10 -10
  26. package/layout/_partials/comments/remark42.ejs +29 -29
  27. package/layout/_partials/comments/twikoo.ejs +25 -25
  28. package/layout/_partials/comments/utterances.ejs +27 -27
  29. package/layout/_partials/comments/valine.ejs +23 -23
  30. package/layout/_partials/comments/waline.ejs +24 -24
  31. package/layout/_partials/comments.ejs +8 -8
  32. package/layout/_partials/css.ejs +9 -9
  33. package/layout/_partials/footer/beian.ejs +33 -33
  34. package/layout/_partials/footer/statistics.ejs +39 -39
  35. package/layout/_partials/footer.ejs +7 -7
  36. package/layout/_partials/head.ejs +46 -46
  37. package/layout/_partials/header/banner.ejs +24 -24
  38. package/layout/_partials/header/navigation.ejs +56 -56
  39. package/layout/_partials/header.ejs +4 -4
  40. package/layout/_partials/markdown-plugins.ejs +24 -24
  41. package/layout/_partials/paginator.ejs +14 -14
  42. package/layout/_partials/plugins/CSR.ejs +4 -0
  43. package/layout/_partials/plugins/analytics.ejs +75 -75
  44. package/layout/_partials/plugins/anchorjs.ejs +39 -39
  45. package/layout/_partials/plugins/code-widget.ejs +7 -7
  46. package/layout/_partials/plugins/encrypt.ejs +18 -18
  47. package/layout/_partials/plugins/fancybox.ejs +11 -11
  48. package/layout/_partials/plugins/highlight.ejs +13 -13
  49. package/layout/_partials/plugins/math.ejs +51 -51
  50. package/layout/_partials/plugins/mermaid.ejs +4 -4
  51. package/layout/_partials/plugins/nprogress.ejs +7 -7
  52. package/layout/_partials/plugins/typed.ejs +20 -20
  53. package/layout/_partials/post/category-bar.ejs +18 -18
  54. package/layout/_partials/post/copyright.ejs +50 -50
  55. package/layout/_partials/post/css.ejs +3 -3
  56. package/layout/_partials/post/meta-bottom.ejs +16 -16
  57. package/layout/_partials/post/meta-top.ejs +27 -27
  58. package/layout/_partials/post/scripts.ejs +8 -7
  59. package/layout/_partials/post/sidebar-left.ejs +1 -1
  60. package/layout/_partials/post/sidebar-right.ejs +2 -2
  61. package/layout/_partials/post/toc.ejs +6 -6
  62. package/layout/_partials/scripts.ejs +10 -10
  63. package/layout/_partials/search.ejs +19 -19
  64. package/layout/about.ejs +22 -22
  65. package/layout/archive.ejs +10 -10
  66. package/layout/categories.ejs +20 -20
  67. package/layout/category.ejs +12 -12
  68. package/layout/index.ejs +61 -61
  69. package/layout/layout.ejs +60 -60
  70. package/layout/links.ejs +31 -31
  71. package/layout/page.ejs +15 -15
  72. package/layout/post.ejs +77 -77
  73. package/layout/tag.ejs +12 -12
  74. package/layout/tags.ejs +26 -26
  75. package/package.json +74 -70
  76. package/scripts/index.js +1 -1
  77. package/source/css/_functions/base.styl +8 -8
  78. package/source/css/_mixins/base.styl +23 -23
  79. package/source/css/_pages/_about/about.styl +32 -32
  80. package/source/css/_pages/_archive/archive.styl +32 -32
  81. package/source/css/_pages/_base/_widget/anchorjs.styl +8 -8
  82. package/source/css/_pages/_base/_widget/banner.styl +29 -29
  83. package/source/css/_pages/_base/_widget/board.styl +11 -11
  84. package/source/css/_pages/_base/_widget/code-widget.styl +37 -36
  85. package/source/css/_pages/_base/_widget/copyright.styl +91 -90
  86. package/source/css/_pages/_base/_widget/footer.styl +65 -65
  87. package/source/css/_pages/_base/_widget/footnote.styl +26 -25
  88. package/source/css/_pages/_base/_widget/header.styl +173 -173
  89. package/source/css/_pages/_base/_widget/modal.styl +100 -100
  90. package/source/css/_pages/_base/_widget/navlink.styl +15 -15
  91. package/source/css/_pages/_base/_widget/ngrogress.styl +12 -12
  92. package/source/css/_pages/_base/_widget/noscript.styl +13 -12
  93. package/source/css/_pages/_base/_widget/pagination.styl +23 -23
  94. package/source/css/_pages/_base/_widget/qrcode.styl +17 -17
  95. package/source/css/_pages/_base/_widget/scroll-btn.styl +48 -48
  96. package/source/css/_pages/_base/_widget/text.styl +20 -19
  97. package/source/css/_pages/_base/_widget/toc.styl +75 -75
  98. package/source/css/_pages/_base/base.styl +67 -68
  99. package/source/css/_pages/_base/color-schema.styl +79 -75
  100. package/source/css/_pages/_base/inline.styl +51 -51
  101. package/source/css/_pages/_base/keyframes.styl +31 -31
  102. package/source/css/_pages/_base/print.styl +39 -38
  103. package/source/css/_pages/_category/category-bar.styl +58 -58
  104. package/source/css/_pages/_category/category-chain.styl +6 -6
  105. package/source/css/_pages/_category/category-list.styl +62 -62
  106. package/source/css/_pages/_index/index.styl +75 -75
  107. package/source/css/_pages/_links/links.styl +80 -79
  108. package/source/css/_pages/_post/comment.styl +28 -27
  109. package/source/css/_pages/_post/highlight.styl +76 -75
  110. package/source/css/_pages/_post/markdown.styl +96 -96
  111. package/source/css/_pages/_post/post-page.styl +179 -179
  112. package/source/css/_pages/_post/post-plugin.styl +10 -0
  113. package/source/css/_pages/_post/post-tag.styl +75 -29
  114. package/source/css/_pages/_tag/tags.styl +9 -9
  115. package/source/css/_pages/pages.styl +8 -8
  116. package/source/css/_variables/base.styl +72 -72
  117. package/source/css/gitalk.css +546 -546
  118. package/source/css/main.styl +19 -19
  119. package/source/img/chat/responder.jpg +0 -0
  120. package/source/img/chat/sender.jpg +0 -0
  121. package/source/img/default8.jpg +0 -0
  122. package/source/js/color-schema.js +279 -279
  123. package/source/js/events.js +72 -72
  124. package/source/js/img-lazyload.js +10 -10
  125. package/source/js/local-search.js +70 -70
  126. package/source/js/post/copying-code.js +34 -34
  127. package/source/js/post/enable.js +6 -6
  128. package/source/js/post/img-swipe-bf.js +47 -47
  129. package/source/js/post/img-swipe.js +84 -35
  130. package/source/js/post/mermaiding.js +9 -9
  131. package/source/js/post/play-imgs.js +58 -58
  132. package/source/js/post/toc.js +24 -24
  133. package/source/js/post/view-imgs.js +27 -27
  134. package/source/js/utils.js +245 -245
  135. package/source/xml/local-search.xml +45 -45
  136. package/templates/Chat.vue +52 -0
  137. package/templates/GroupImage.vue +36 -0
  138. package/templates/MenuNav.vue +39 -0
  139. package/templates/Note.vue +33 -0
  140. package/templates/Noun.vue +25 -0
  141. package/templates/NounContent.vue +29 -0
  142. package/templates/Tab.vue +40 -0
  143. package/templates/footer.ejs +12 -12
  144. package/templates/utils/uri.ts +40 -0
  145. package/source/css/_pages/_tag/tag.styl +0 -9
  146. package/templates/noun.vue +0 -18
@@ -0,0 +1,39 @@
1
+ <template>
2
+ <div :class="['btn-group', typeBgClass(type)]" role="group">
3
+ <div class="btn-group" role="group" v-for="menu in menus">
4
+ <button
5
+ type="button"
6
+ :class="['btn', `btn-outline-${type}`, 'dropdown-toggle']"
7
+ data-bs-toggle="dropdown"
8
+ aria-expanded="false"
9
+ >
10
+ {{ menu.text }}
11
+ </button>
12
+ <ul :class="['dropdown-menu']">
13
+ <li v-for="item in menu.secondaryMenus">
14
+ <a
15
+ :class="['dropdown-item']"
16
+ :href="uriFor([item.link])"
17
+ >
18
+ {{ item.text }}
19
+ </a>
20
+ </li>
21
+ </ul>
22
+ </div>
23
+ </div>
24
+ </template>
25
+
26
+ <script setup lang="ts">
27
+ import { uriFor, typeBgClass } from './utils/uri'
28
+ import type { Type } from '../types/tag'
29
+ type SecondaryMenu = {
30
+ text: string
31
+ link: string
32
+ }
33
+ type FirstMenu = {
34
+ text: string
35
+ secondaryMenus: SecondaryMenu[]
36
+ }
37
+ const type: Type = 'warning'
38
+ const menus: FirstMenu[] = []
39
+ </script>
@@ -0,0 +1,33 @@
1
+ <template>
2
+ <div
3
+ v-if="iconType"
4
+ :class="[
5
+ 'note',
6
+ 'alert',
7
+ `alert-${alertType}`,
8
+ 'd-flex',
9
+ 'align-items-top',
10
+ ]"
11
+ role="alert"
12
+ >
13
+ <svg
14
+ class="flex-shrink-0 me-2"
15
+ role="img"
16
+ width="1.2em"
17
+ height="1.2em"
18
+ :style="{marginTop: '0.2rem'}"
19
+ >
20
+ <use :xlink:href="`#${iconType}`"></use>
21
+ </svg>
22
+ <div v-html="html"></div>
23
+ </div>
24
+ <div v-else :class="['note', 'alert', `alert-${alertType}`]">
25
+ <div v-html="html"></div>
26
+ </div>
27
+ </template>
28
+ <script lang="ts" setup>
29
+ import type { Type } from '../types/tag'
30
+ const alertType: Type = 'info'
31
+ const iconType: Type = 'info'
32
+ const html: string = ''
33
+ </script>
@@ -0,0 +1,25 @@
1
+ <template>
2
+ <button
3
+ type="button"
4
+ :class="['btn', 'btn-link', `text-${type}-emphasis`, 'lnote-popover-btn']"
5
+ data-bs-toggle="popover"
6
+ data-bs-trigger="hover focus"
7
+ data-bs-placement="right"
8
+ :data-bs-custom-class="`lnote-popover ${type}`"
9
+ data-bs-html="true"
10
+ :data-bs-content="content"
11
+ >
12
+ {{ text }}
13
+ <svg width="18" height="18">
14
+ <use xlink:href="#question-circle-fill"></use>
15
+ </svg>
16
+ </button>
17
+ </template>
18
+
19
+ <script lang="ts" setup>
20
+ import { typeBgClass } from './utils/uri'
21
+ import type { Type } from '../types/tag'
22
+ const type: Type = 'primary'
23
+ const content = ''
24
+ const text = ''
25
+ </script>
@@ -0,0 +1,29 @@
1
+ <template>
2
+ <div :class="['card', `border-${type}`]">
3
+ <div :class="['card-header', 'fw-bold', `text-bg-${type}`]">{{ title }}</div>
4
+ <div :class="['card-body', `bg-${type}-subtle`, 'rounded-bottom']">
5
+ <!-- <h5 class="card-title" v-if="title">{{ title }}</h5> -->
6
+ <p class="card-text">
7
+ {{ text }}
8
+ </p>
9
+ <a
10
+ v-if="link"
11
+ :href="uriFor([link])"
12
+ :class="['card-link', `text-${type}-emphasis`]"
13
+ >
14
+ {{ moreText }}
15
+ </a>
16
+ </div>
17
+ </div>
18
+ </template>
19
+
20
+ <script lang="ts" setup>
21
+ import { uriFor, typeBgClass } from './utils/uri'
22
+ import type { Type } from '../types/tag'
23
+ const type: Type = 'primary'
24
+ // const promptText = ''
25
+ const moreText = ''
26
+ const title = ''
27
+ const text = ''
28
+ const link = ''
29
+ </script>
@@ -0,0 +1,40 @@
1
+ <template>
2
+ <nav>
3
+ <ul
4
+ class="nav nav-underline mb-3 d-flex flex-nowrap overflow-x-auto text-nowrap border-bottom"
5
+ role="tablist"
6
+ >
7
+ <li class="nav-item" role="presentation" v-for="(item, index) in tabs">
8
+ <button
9
+ data-bs-toggle="tab"
10
+ role="tab"
11
+ type="button"
12
+ :aria-selected="index === 0 ? 'true' : 'false'"
13
+ :class="['nav-link', { active: index === 0 }]"
14
+ :id="`tab-${key}-${index}`"
15
+ :data-bs-target="`#nav-${key}-${index}`"
16
+ :aria-controls="`nav-${key}-${index}`"
17
+ >
18
+ {{ item.name }}
19
+ </button>
20
+ </li>
21
+ </ul>
22
+ <div class="tab-content">
23
+ <div
24
+ v-for="(item, index) in tabs"
25
+ :class="['tab-pane', 'fade', index === 0 && 'show active']"
26
+ :id="`nav-${key}-${index}`"
27
+ role="tabpanel"
28
+ :aria-labelledby="`tab-${key}-${index}`"
29
+ :tabindex="index"
30
+ >
31
+ <div v-html="item.content"></div>
32
+ </div>
33
+ </div>
34
+ </nav>
35
+ </template>
36
+ <script lang="ts" setup>
37
+ import type { Tab } from '../types/tag'
38
+ const key: string = ''
39
+ const tabs: Tab[] = []
40
+ </script>
@@ -1,13 +1,13 @@
1
- <footer>
2
- <div class="footer-inner">
3
- <div class="footer-content">
4
- <a href="<%= href %>" rel="nofollow noopener">
5
- <%= name %>
6
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-heart-fill" viewBox="0 0 16 16">
7
- <path fill-rule="evenodd" d="M8 1.314C12.438-3.248 23.534 4.735 8 15-7.534 4.736 3.562-3.248 8 1.314z"/>
8
- </svg>
9
- <%= version %>
10
- </a>
11
- </div>
12
- </div>
1
+ <footer>
2
+ <div class="footer-inner">
3
+ <div class="footer-content">
4
+ <a href="<%= href %>" rel="nofollow noopener">
5
+ <%= name %>
6
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-heart-fill" viewBox="0 0 16 16">
7
+ <path fill-rule="evenodd" d="M8 1.314C12.438-3.248 23.534 4.735 8 15-7.534 4.736 3.562-3.248 8 1.314z"/>
8
+ </svg>
9
+ <%= version %>
10
+ </a>
11
+ </div>
12
+ </div>
13
13
  </footer>
@@ -0,0 +1,40 @@
1
+ import fs from 'fs'
2
+ import path from 'path'
3
+ import type { Type } from '../../types/tag'
4
+
5
+ function runtimeProjectInfo() {
6
+ const projectPath = path.resolve(process.cwd(), 'package.json')
7
+ return JSON.parse(fs.readFileSync(projectPath, 'utf-8'))
8
+ }
9
+
10
+ function linkIsCDN(url: string) {
11
+ if (/^https*:\/\//.test(url) || /^\/\//.test(url)) {
12
+ return true
13
+ }
14
+ return false
15
+ }
16
+
17
+ /**
18
+ * @description 图片链接生成
19
+ * 1. http或https开头的cdn链接,将原样转换回去,且只会返回第一个
20
+ * 2. 多个链接组合成一个,并在前面添加上当前项目的name
21
+ * @param {string[]} uris uri组,每一个uri必须带 / 开头,保持和 hexo 图片标签一样
22
+ * @returns
23
+ */
24
+ export function uriFor(uris: string[]) {
25
+ if (uris.length === 1 && linkIsCDN(uris[0])) {
26
+ return uris[0]
27
+ }
28
+ const { name } = runtimeProjectInfo()
29
+ return ['/', name, ...uris].join('')
30
+ }
31
+
32
+ export function typeBgClass(type: Type) {
33
+ if (['warning', 'info', 'light'].includes(type)) {
34
+ return 'bg-dark'
35
+ }
36
+ if (['dark'].includes(type)) {
37
+ return 'bg-light'
38
+ }
39
+ return ''
40
+ }
@@ -1,9 +0,0 @@
1
- .lnote-popover-btn
2
- --bs-btn-padding-y: 0
3
- --bs-btn-line-height: 1
4
- .lnote-popover
5
- --bs-popover-border-color: var(--bs-primary)
6
- --bs-popover-header-bg: var(--bs-primary)
7
- --bs-popover-header-color: var(--bs-white)
8
- --bs-popover-body-padding-x: 1rem
9
- --bs-popover-body-padding-y: .5rem
@@ -1,18 +0,0 @@
1
- <template>
2
- <button v-if="title == null" type="button" class="btn btn-link lnote-popover-btn" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="right"
3
- data-bs-custom-class="lnote-popover" :data-bs-content="desc">
4
- {{ text }}
5
- <svg width="18" height="18"><use xlink:href="#question-circle-fill"></use></svg>
6
- </button>
7
- <button v-else type="button" class="btn btn-link lnote-popover-btn" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="right"
8
- data-bs-custom-class="lnote-popover" :data-bs-title="title" :data-bs-content="desc">
9
- {{ text }}
10
- <svg width="18" height="18"><use xlink:href="#question-circle-fill"></use></svg>
11
- </button>
12
- </template>
13
-
14
- <script lang="ts" setup>
15
- const title: string | undefined = undefined
16
- const desc = ''
17
- const text = ''
18
- </script>