@sugarat/theme 0.1.11 → 0.1.13

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sugarat/theme",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "简约风的 Vitepress 博客主题,sugarat vitepress blog theme",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -24,7 +24,7 @@
24
24
  <!-- 简介 -->
25
25
  <div class="des">
26
26
  <!-- title -->
27
- <el-link type="info" class="title" :href="v.route">{{
27
+ <el-link type="info" class="title" :href="withBase(v.route)">{{
28
28
  v.meta.title
29
29
  }}</el-link>
30
30
  <!-- 描述信息 -->
@@ -42,6 +42,7 @@
42
42
  <script lang="ts" setup>
43
43
  import { ref, computed } from 'vue'
44
44
  import { ElButton, ElLink } from 'element-plus'
45
+ import { withBase } from 'vitepress'
45
46
  import { useArticles, useBlogConfig } from '../composables/config/blog'
46
47
  import { formatShowDate } from '../utils/index'
47
48
 
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <a class="blog-item" :href="route">
2
+ <a class="blog-item" :href="withBase(route)">
3
3
  <i class="pin" v-if="!!pin"></i>
4
4
  <!-- 左侧信息 -->
5
5
  <div class="info-part">
@@ -22,6 +22,7 @@
22
22
  </template>
23
23
 
24
24
  <script lang="ts" setup>
25
+ import { withBase } from 'vitepress'
25
26
  import { computed } from 'vue'
26
27
  import { formatShowDate } from '../utils/index'
27
28
 
@@ -42,7 +42,7 @@
42
42
  <script lang="ts" setup>
43
43
  import { ref, computed } from 'vue'
44
44
  import { ElButton, ElLink } from 'element-plus'
45
- import { useRoute } from 'vitepress'
45
+ import { useRoute, withBase } from 'vitepress'
46
46
  import { formatShowDate } from '../utils/index'
47
47
  import { useArticles, useBlogConfig } from '../composables/config/blog'
48
48
 
@@ -59,6 +59,7 @@ const route = useRoute()
59
59
  const recommendList = computed(() => {
60
60
  const paths = route.path.split('/')
61
61
  const origin = docs.value
62
+ .map((v) => ({ ...v, route: withBase(v.route) }))
62
63
  // 过滤出公共路由前缀
63
64
  // 限制为同路由前缀
64
65
  .filter(
@@ -33,7 +33,7 @@
33
33
  >
34
34
  <Command.Item
35
35
  v-for="item in showSearchResult"
36
- :data-value="item.route"
36
+ :data-value="withBase(item.route)"
37
37
  :key="item.route"
38
38
  @select="handleSelect"
39
39
  >
@@ -131,7 +131,7 @@
131
131
  import { computed, nextTick, ref, watch } from 'vue'
132
132
  // @ts-ignore
133
133
  import { Command } from 'vue-command-palette'
134
- import { useRoute, useRouter } from 'vitepress'
134
+ import { useRoute, useRouter, withBase } from 'vitepress'
135
135
  import { useMagicKeys } from '@vueuse/core'
136
136
  import { formatDate } from '../utils'
137
137
  import { useArticles, useBlogConfig } from '../composables/config/blog'
@@ -1,7 +1,7 @@
1
1
  .algolia {
2
- [command-root] {
3
- padding: 8px;
4
- }
2
+ // [command-root] {
3
+ // // padding: 8px;
4
+ // }
5
5
 
6
6
  [command-input] {
7
7
  font-family: var(--font-sans);