valaxy-theme-yun 0.17.0-beta.2 → 0.17.0-beta.4

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/README.md CHANGED
@@ -12,7 +12,7 @@ See [Docs](./docs/README.md).
12
12
 
13
13
  ### Development
14
14
 
15
- Just run and visit <http://localhost:3333>
15
+ Just run and visit `http://localhost:${port}/` displayed in your terminal.
16
16
 
17
17
  ```bash
18
18
  pnpm dev
@@ -24,7 +24,7 @@ const categoryList = computed(() => {
24
24
  </script>
25
25
 
26
26
  <template>
27
- <ul v-for="category in categories" :key="category.name" class="category-list" m="l-4">
27
+ <ul v-for="category in categories.values()" :key="category.name" class="category-list" m="l-4">
28
28
  <YunCategory
29
29
  :parent-key="category.name"
30
30
  :category="category"
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" setup>
2
2
  import { computed, onMounted, ref } from 'vue'
3
- import type { Category, Post } from 'valaxy'
3
+ import type { CategoryList, Post } from 'valaxy'
4
4
  import { isCategoryList, useInvisibleElement } from 'valaxy'
5
5
  import { useI18n } from 'vue-i18n'
6
6
  import { useRoute, useRouter } from 'vue-router'
@@ -8,7 +8,7 @@ import { useRoute, useRouter } from 'vue-router'
8
8
  const props = withDefaults(defineProps<{
9
9
  parentKey: string
10
10
  // to eliminate the warning
11
- category: Category
11
+ category: Post | CategoryList
12
12
  level?: number
13
13
 
14
14
  /**
@@ -74,7 +74,7 @@ onMounted(() => {
74
74
 
75
75
  <template v-if="!collapse">
76
76
  <ul>
77
- <li v-for="categoryItem, i in category.children" :key="i" class="post-list-item" m="l-4">
77
+ <li v-for="categoryItem, i in category.children.values()" :key="i" class="post-list-item" m="l-4">
78
78
  <template v-if="isCategoryList(categoryItem)">
79
79
  <YunCategory
80
80
  :parent-key="parentKey ? `${parentKey}/${categoryItem.name}` : categoryItem.name"
@@ -21,7 +21,7 @@ const router = useRouter()
21
21
  {{ siteConfig.author.name }}
22
22
  </RouterLink>
23
23
  </div>
24
- <RouterLink v-if="router.hasRoute('about-site')" to="/about/site" class="site-name">
24
+ <RouterLink v-if="router.hasRoute('/about/site')" to="/about/site" class="site-name">
25
25
  {{ siteConfig.title }}
26
26
  </RouterLink>
27
27
  <span v-else class="site-name">{{ siteConfig.title }}</span>
@@ -28,6 +28,8 @@ export default defineConfig<ThemeConfig>({
28
28
  banner: {
29
29
  enable: true,
30
30
  title: '云游君的小站',
31
+ // 手动分割
32
+ // title: ['云游君的', '小站'],
31
33
  cloud: {
32
34
  enable: true
33
35
  }
package/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './node'
@@ -55,7 +55,7 @@ useSchemaOrg([
55
55
  </template>
56
56
  <template #main-content>
57
57
  <div text="center" class="yun-text-light" p="2">
58
- {{ t('counter.categories', categories.children.length) }}
58
+ {{ t('counter.categories', Array.from(categories.children).length) }}
59
59
  </div>
60
60
  <YunCategories :categories="categories.children" />
61
61
  <RouterView />
package/node/config.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ThemeConfig } from '../types'
1
+ import type { ThemeConfig, UserThemeConfig } from '../types'
2
2
 
3
3
  /**
4
4
  * Default Config
@@ -119,3 +119,12 @@ export const defaultThemeConfig: ThemeConfig = {
119
119
  },
120
120
  },
121
121
  }
122
+
123
+ /**
124
+ * valaxy-theme-yun
125
+ * @see https://github.com/YunYouJun/valaxy/tree/main/packages/valaxy-theme-yun
126
+ * define theme config
127
+ */
128
+ export function defineThemeConfig(config: UserThemeConfig) {
129
+ return config
130
+ }
package/node/unocss.ts CHANGED
@@ -5,7 +5,7 @@ import type { UserThemeConfig } from '../types'
5
5
  * generateSafelist by config
6
6
  */
7
7
  export function generateSafelist(options: ResolvedValaxyOptions<UserThemeConfig>) {
8
- const themeConfig = options.config.themeConfig || {}
8
+ const themeConfig = options?.config.themeConfig || {}
9
9
  const safelist = []
10
10
 
11
11
  const types = themeConfig.types
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy-theme-yun",
3
- "version": "0.17.0-beta.2",
3
+ "version": "0.17.0-beta.4",
4
4
  "author": {
5
5
  "email": "me@yunyoujun.cn",
6
6
  "name": "YunYouJun",
@@ -12,19 +12,20 @@
12
12
  "url": "https://github.com/YunYouJun/valaxy/tree/main/packages/valaxy-theme-yun"
13
13
  },
14
14
  "exports": {
15
+ "./theme": "./types/index.d.ts",
15
16
  "./*": "./*"
16
17
  },
17
- "main": "node/index.ts",
18
- "types": "types/index.d.ts",
18
+ "main": "index.ts",
19
+ "module": "index.ts",
19
20
  "dependencies": {
20
21
  "@explosions/fireworks": "^0.0.2",
21
22
  "@iconify-json/ant-design": "^1.1.13",
22
- "@iconify-json/simple-icons": "^1.1.87",
23
+ "@iconify-json/simple-icons": "^1.1.88",
23
24
  "animejs": "^3.2.2"
24
25
  },
25
26
  "devDependencies": {
26
27
  "@types/animejs": "^3.1.12",
27
- "valaxy": "0.17.0-beta.2",
28
+ "valaxy": "0.17.0-beta.4",
28
29
  "valaxy-addon-waline": "0.1.1"
29
30
  }
30
31
  }
package/styles/index.scss CHANGED
@@ -1,3 +1,5 @@
1
+ $c-primary: #0078e7 !default;
2
+
1
3
  @use "./layout" as *;
2
4
  @forward "star-markdown-css/src/scss/theme/yun.scss" with (
3
5
  $colors: (
@@ -8,6 +10,5 @@
8
10
  // override the default style of star-markdown-css
9
11
  @use "./common/button.scss" as *;
10
12
  @use "./common/markdown.scss" as *;
11
-
12
13
  @use 'valaxy/client/styles/components/code-group.scss' as *;
13
14
  @use 'valaxy/client/styles/components/custom-block.scss' as *;
@@ -0,0 +1,3 @@
1
+ import { defaultThemeConfig, defineThemeConfig } from './node'
2
+
3
+ export default defineThemeConfig(defaultThemeConfig)
package/valaxy.config.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import type { ResolvedValaxyOptions } from 'valaxy'
2
- import { defineValaxyTheme } from 'valaxy'
3
2
  import type { Plugin } from 'vite'
3
+ import { defineTheme } from 'valaxy'
4
4
  import type { ThemeConfig } from './types'
5
- import { defaultThemeConfig, generateSafelist } from './node'
5
+ import { defaultThemeConfig, generateSafelist } from './index'
6
6
 
7
7
  function ThemeVitePlugin(options: ResolvedValaxyOptions<ThemeConfig>): Plugin {
8
- const themeConfig = options.config.themeConfig || {}
8
+ const themeConfig = options?.config.themeConfig || {}
9
9
  return {
10
10
  name: 'valaxy-theme-yun',
11
11
  enforce: 'pre',
@@ -27,7 +27,7 @@ function ThemeVitePlugin(options: ResolvedValaxyOptions<ThemeConfig>): Plugin {
27
27
  }
28
28
  }
29
29
 
30
- export default defineValaxyTheme<ThemeConfig>((options) => {
30
+ export default defineTheme<ThemeConfig>((options) => {
31
31
  return {
32
32
  themeConfig: defaultThemeConfig,
33
33
  vite: {