valaxy-theme-press 0.0.4 → 0.1.1

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
@@ -2,6 +2,13 @@
2
2
 
3
3
  This is a theme for valaxy docs.
4
4
 
5
+ Inspired by [vitepress](https://vitepress.dev).
6
+
7
+ 我开发此主题以编写 Valaxy 的初期文档,同时以便发现 valaxy 编写主题中的痛点。
8
+ <!-- 它增加了 VitePress 一些所没有的功能,而随着 VitePress 的完善,该主题将不再被维护,文档也将在未来迁移至 VitePress。 -->
9
+
10
+ - [预览](https://press.valaxy.site)
11
+
5
12
  ## Reference
6
13
 
7
14
  - [vitepress](https://vitepress.vuejs.org/)
Binary file
@@ -18,12 +18,12 @@ const app = useAppStore()
18
18
  <ValaxyOverlay :show="app.isRightSidebarOpen" @click="app.toggleRightSidebar()" />
19
19
 
20
20
  <aside
21
- class="press-aside lt-xl:fixed shadow
22
- press-card xl:(shadow-none hover:shadow-none) hover:shadow-lg"
21
+ class="press-aside lt-xl:fixed shadow xl:(shadow-none hover:shadow-none) hover:shadow-lg"
23
22
  flex="~ col grow"
24
23
  p="l-0 xl:l-8" text="center"
25
24
  z="$"
26
25
  :class="app.isRightSidebarOpen && 'open'"
26
+ bg="$va-c-bg"
27
27
  >
28
28
  <div class="aside-curtain" />
29
29
  <div class="aside-container lt-xl:fixed" flex="~ col">
@@ -41,10 +41,6 @@ const app = useAppStore()
41
41
  <style lang="scss">
42
42
  @use 'valaxy/client/styles/mixins/index.scss' as *;
43
43
 
44
- .press-card{
45
- background-color: var(--va-c-bg);
46
- }
47
-
48
44
  .press-aside {
49
45
  top: 0;
50
46
  bottom: 0;
@@ -1,6 +1,8 @@
1
1
  <script lang="ts" setup>
2
2
  import { computed } from 'vue'
3
3
 
4
+ import { useI18n } from 'vue-i18n'
5
+
4
6
  const props = defineProps<{
5
7
  theme: 'brand' | 'alt'
6
8
  link: string
@@ -16,6 +18,8 @@ const classes = computed(() => {
16
18
 
17
19
  return arr
18
20
  })
21
+
22
+ const { t } = useI18n()
19
23
  </script>
20
24
 
21
25
  <template>
@@ -26,6 +30,6 @@ const classes = computed(() => {
26
30
  class="sese-btn btn rounded-full hover:shadow-lg" bg="gradient-to-r"
27
31
  p="x-6"
28
32
  >
29
- {{ text }}
33
+ {{ t(text) }}
30
34
  </AppLink>
31
35
  </template>
@@ -2,6 +2,7 @@
2
2
  import { useThemeConfig } from 'valaxy'
3
3
  import type { Categories } from 'valaxy'
4
4
  import { computed, ref } from 'vue'
5
+ import type { PressTheme } from '../types'
5
6
 
6
7
  const props = withDefaults(defineProps<{
7
8
  categories: Categories
@@ -18,15 +19,19 @@ const props = withDefaults(defineProps<{
18
19
 
19
20
  const collapsable = ref(props.collapsable)
20
21
 
21
- const themeConfig = useThemeConfig()
22
+ const themeConfig = useThemeConfig<PressTheme.Config>()
22
23
  const sidebar = computed(() => themeConfig.value.sidebar)
24
+
25
+ function getCategoryByName(name: string) {
26
+ return props.categories.find(c => c.name === name)
27
+ }
23
28
  </script>
24
29
 
25
30
  <template>
26
31
  <ul v-for="item in sidebar" :key="item" class="category-list">
27
32
  <PressCategory
28
- v-if="categories.find(c => c.name === item)"
29
- :category="categories.find(c => c.name === item)"
33
+ v-if="getCategoryByName(item)"
34
+ :category="getCategoryByName(item)"
30
35
  :level="level + 1"
31
36
  :display-category="displayCategory"
32
37
  :collapsable="collapsable"
@@ -33,28 +33,30 @@ function getTitle(post: Post | any) {
33
33
  p="t-2"
34
34
  w="full" border="t t-$pr-c-divider-light"
35
35
  class="category-list-item inline-flex items-center justify-between"
36
+ tabindex="0"
36
37
  >
37
38
  <span class="category-name" font="bold" m="l-1" @click="displayCategory ? displayCategory(category.name) : null">
38
- {{ category.name === 'Uncategorized' ? t('category.uncategorized') : category.name }}
39
+ {{ category.name === 'Uncategorized' ? t('category.uncategorized') : t(`category.${category.name}`) }}
39
40
  <!-- <sup font="normal">[{{ category.total }}]</sup> -->
40
41
  </span>
41
- <span class="folder-action inline-flex cursor-pointer" opacity="50" @click="collapsable = !collapsable">
42
+ <button
43
+ tabindex="0" role="button" aria-label="toggle section"
44
+ class="folder-action inline-flex cursor-pointer" opacity="50" @click="collapsable = !collapsable"
45
+ >
42
46
  <div v-if="collapsable" i-ri-folder-add-line />
43
47
  <div v-else i-ri-folder-reduce-line />
44
- </span>
48
+ </button>
45
49
  </li>
46
50
 
47
- <template v-if="!collapsable">
48
- <ul>
49
- <li v-for="categoryItem, i in category.children" :key="i" class="post-list-item">
50
- <template v-if="!isCategoryList(categoryItem)">
51
- <router-link v-if="categoryItem.title" :to="categoryItem.path || ''" class="inline-flex items-center" active-class="active">
52
- <span m="l-1" text="sm">{{ getTitle(categoryItem) }}</span>
53
- </router-link>
54
- </template>
51
+ <ul v-if="!collapsable">
52
+ <li v-for="categoryItem, i in category.children" :key="i" class="post-list-item">
53
+ <template v-if="!isCategoryList(categoryItem)">
54
+ <router-link v-if="categoryItem.title" :to="categoryItem.path || ''" class="inline-flex items-center" active-class="active">
55
+ <span m="l-1" text="sm">{{ getTitle(categoryItem) }}</span>
56
+ </router-link>
57
+ </template>
55
58
 
56
- <PressCategory v-else :category="categoryItem" :display-category="displayCategory" :collapsable="collapsable" />
57
- </li>
58
- </ul>
59
- </template>
59
+ <PressCategory v-else :category="categoryItem" :display-category="displayCategory" :collapsable="collapsable" />
60
+ </li>
61
+ </ul>
60
62
  </template>
@@ -1,9 +1,10 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, onMounted, ref, watchEffect } from 'vue'
3
3
  import { useData, useThemeConfig } from 'valaxy'
4
+ import type { PressTheme } from '../types'
4
5
 
5
6
  const data = useData()
6
- const themeConfig = useThemeConfig()
7
+ const themeConfig = useThemeConfig<PressTheme.Config>()
7
8
 
8
9
  const date = computed(() => new Date(data.lastUpdated!))
9
10
  const isoDatetime = computed(() => date.value.toISOString())
@@ -1,21 +1,29 @@
1
1
  <script setup lang="ts">
2
+ import { useI18n } from 'vue-i18n'
2
3
  import type { Feature } from '../types'
3
4
 
4
5
  defineProps<{
5
6
  feature: Feature
6
7
  }>()
8
+
9
+ const { t } = useI18n()
7
10
  </script>
8
11
 
9
12
  <template>
10
13
  <article class="press-feature">
11
14
  <div v-if="feature.icon" class="icon">
12
- {{ feature.icon }}
15
+ <template v-if="feature.icon.startsWith('i-')">
16
+ <div :class="feature.icon" />
17
+ </template>
18
+ <template v-else>
19
+ {{ feature.icon }}
20
+ </template>
13
21
  </div>
14
22
  <h2 class="title">
15
- {{ feature.title }}
23
+ {{ t(feature.title) }}
16
24
  </h2>
17
25
  <p class="details">
18
- {{ feature.details }}
26
+ {{ t(feature.details) }}
19
27
  </p>
20
28
  </article>
21
29
  </template>
@@ -35,10 +43,11 @@ defineProps<{
35
43
  align-items: center;
36
44
  margin-bottom: 20px;
37
45
  border-radius: 6px;
38
- background-color: var(--va-c-gray-light-4);
46
+ background-color: var(--vp-c-default-soft);
39
47
  width: 48px;
40
48
  height: 48px;
41
49
  font-size: 24px;
50
+ transition: background-color 0.25s;
42
51
  }
43
52
 
44
53
  .dark .icon {
@@ -1,8 +1,11 @@
1
1
  <script lang="ts" setup>
2
2
  import { useFrontmatter } from 'valaxy'
3
+ import { useI18n } from 'vue-i18n'
3
4
  import PressButton from './PressButton.vue'
4
5
 
5
6
  const fm = useFrontmatter()
7
+
8
+ const { t } = useI18n()
6
9
  </script>
7
10
 
8
11
  <template>
@@ -14,9 +17,9 @@ const fm = useFrontmatter()
14
17
  </div>
15
18
 
16
19
  <h2 m="b-10" text="center 6xl" font="black" leading="tight">
17
- Next Generation
20
+ {{ t('banner.next-generation') }}
18
21
  <br>
19
- Static <span class="gradient-text from-blue-500 to-purple-700" bg="gradient-to-r">Blog</span> Framework
22
+ {{ t('banner.static') }} <span class="gradient-text from-blue-500 to-purple-700" bg="gradient-to-r">{{ t('banner.blog') }}</span> {{ t('banner.framework') }}
20
23
  </h2>
21
24
 
22
25
  <div p="2" text="center">
@@ -1,6 +1,8 @@
1
1
  <script lang="ts" setup>
2
2
  import { useSidebar } from 'valaxy'
3
3
 
4
+ import { useI18n } from 'vue-i18n'
5
+
4
6
  defineProps<{
5
7
  open: boolean
6
8
  }>()
@@ -14,6 +16,8 @@ const { hasSidebar } = useSidebar()
14
16
  function scrollToTop() {
15
17
  window.scrollTo({ top: 0, left: 0, behavior: 'smooth' })
16
18
  }
19
+
20
+ const { t } = useI18n()
17
21
  </script>
18
22
 
19
23
  <template>
@@ -25,11 +29,13 @@ function scrollToTop() {
25
29
  @click="$emit('openMenu')"
26
30
  >
27
31
  <div i-ri-align-left class="menu-icon" />
28
- <span class="menu-text">Menu</span>
32
+ <span class="menu-text">
33
+ {{ t('menu.title') }}
34
+ </span>
29
35
  </button>
30
36
 
31
37
  <a class="top-link" href="#" @click="scrollToTop">
32
- Return to top
38
+ {{ t('sidebar.return_top') }}
33
39
  </a>
34
40
  </div>
35
41
  </template>
@@ -5,7 +5,7 @@ const themeConfig = useThemeConfig()
5
5
  </script>
6
6
 
7
7
  <template>
8
- <div class="flex lt-md:hidden">
8
+ <div class="flex lt-md:hidden" h="full">
9
9
  <template v-for="item in themeConfig.nav" :key="item.text">
10
10
  <PressNavItemLink v-if="'link' in item" class="px-2" :item="item" />
11
11
  <PressNavItemGroup v-else class="px-2" :item="item" />
@@ -8,7 +8,7 @@ const isAlgolia = computed(() => siteConfig.value.search.type === 'algolia')
8
8
 
9
9
  const PressAlgoliaSearch = isAlgolia.value
10
10
  ? defineAsyncComponent(() => import('./PressAlgoliaSearch.vue'))
11
- : null
11
+ : () => null
12
12
  </script>
13
13
 
14
14
  <template>
@@ -1,5 +1,6 @@
1
1
  <script lang="ts" setup>
2
2
  import { ref } from 'vue'
3
+ import { useI18n } from 'vue-i18n'
3
4
  import type { NavItemGroup } from '../types'
4
5
 
5
6
  defineProps<{
@@ -7,11 +8,14 @@ defineProps<{
7
8
  }>()
8
9
 
9
10
  const open = ref(false)
11
+
12
+ const { t } = useI18n()
10
13
  </script>
11
14
 
12
15
  <template>
13
16
  <div
14
- class="flex self-stretch relative group"
17
+ class="flex relative group"
18
+ h="full"
15
19
  :aria-expanded="open"
16
20
  aria-haspopup="true"
17
21
  @mouseenter="open = true"
@@ -19,18 +23,19 @@ const open = ref(false)
19
23
  >
20
24
  <button
21
25
  type="button"
22
- class="button flex items-center"
26
+ class="button flex items-center bg-transparent"
27
+ h="full"
23
28
  @click="open = !open"
24
29
  >
25
30
  <span class="text">
26
- {{ item.text }}
31
+ {{ t(item.text) }}
27
32
  </span>
28
33
  <div i-ri-arrow-drop-down-line />
29
34
  </button>
30
35
 
31
36
  <div class="menu grow" flex="~ col" items="start">
32
37
  <AppLink v-for="itemLink in item.items" :key="itemLink.text" class="menu-item" p="x-3" :to="itemLink.link">
33
- {{ itemLink.text }}
38
+ {{ t(itemLink.text) }}
34
39
  </AppLink>
35
40
  </div>
36
41
  </div>
@@ -54,6 +59,7 @@ const open = ref(false)
54
59
 
55
60
  .menu {
56
61
  position: absolute;
62
+ top: 20px;
57
63
  left: 50%;
58
64
 
59
65
  min-width: 128px;
@@ -1,5 +1,6 @@
1
1
  <script lang="ts" setup>
2
2
  import { useRoute } from 'vue-router'
3
+ import { useI18n } from 'vue-i18n'
3
4
  import type { NavItemLink } from '../types'
4
5
 
5
6
  defineProps<{
@@ -7,6 +8,8 @@ defineProps<{
7
8
  }>()
8
9
 
9
10
  const route = useRoute()
11
+
12
+ const { t } = useI18n()
10
13
  </script>
11
14
 
12
15
  <template>
@@ -19,7 +22,7 @@ const route = useRoute()
19
22
  rel="noopener"
20
23
  show-external-icon
21
24
  >
22
- {{ item.text }}
25
+ {{ t(item.text) }}
23
26
  </AppLink>
24
27
  </template>
25
28
 
@@ -1,13 +1,13 @@
1
1
  <script lang="ts" setup>
2
- import { useThemeConfig } from '../composables/config'
2
+ import { useI18n } from 'vue-i18n'
3
3
 
4
- const themeConfig = useThemeConfig()
4
+ const { t } = useI18n()
5
5
  </script>
6
6
 
7
7
  <template>
8
8
  <div class="pr-nav-screen-appearance" flex="~ 1">
9
9
  <p class="text">
10
- {{ themeConfig.darkModeSwitchLabel || 'Appearance' }}
10
+ {{ t('button.appearance') }}
11
11
  </p>
12
12
  <PressSwitchAppearance />
13
13
  </div>
@@ -1,6 +1,8 @@
1
1
  <script lang="ts" setup>
2
2
  import { computed, ref } from 'vue'
3
3
 
4
+ import { useI18n } from 'vue-i18n'
5
+
4
6
  const props = defineProps<{
5
7
  text: string
6
8
  items: any[]
@@ -12,6 +14,8 @@ const groupId = computed(() =>
12
14
  `NavScreenGroup-${props.text.replace(' ', '-').toLowerCase()}`,
13
15
  )
14
16
 
17
+ const { t } = useI18n()
18
+
15
19
  function toggle() {
16
20
  isOpen.value = !isOpen.value
17
21
  }
@@ -25,7 +29,7 @@ function toggle() {
25
29
  :aria-expanded="isOpen"
26
30
  @click="toggle"
27
31
  >
28
- <span class="button-text">{{ text }}</span>
32
+ <span class="button-text">{{ t(text) }}</span>
29
33
  <div i-ri-add-line class="button-icon" />
30
34
  </button>
31
35
 
@@ -1,17 +1,21 @@
1
1
  <script lang="ts" setup>
2
2
  import { inject } from 'vue'
3
3
 
4
+ import { useI18n } from 'vue-i18n'
5
+
4
6
  defineProps<{
5
7
  text: string
6
8
  link: string
7
9
  }>()
8
10
 
9
11
  const closeScreen = inject('close-screen') as () => void
12
+
13
+ const { t } = useI18n()
10
14
  </script>
11
15
 
12
16
  <template>
13
17
  <AppLink class="pr-nav-screen-menu-group-link" :to="link" @click="closeScreen">
14
- {{ text }}
18
+ {{ t(text) }}
15
19
  </AppLink>
16
20
  </template>
17
21
 
@@ -5,10 +5,8 @@ import {
5
5
  useOutline,
6
6
  } from 'valaxy'
7
7
  import { useI18n } from 'vue-i18n'
8
- import { useThemeConfig } from '../composables'
9
8
 
10
9
  const { t } = useI18n()
11
- const themeConfig = useThemeConfig()
12
10
 
13
11
  const container = ref()
14
12
  const marker = ref()
@@ -22,7 +20,7 @@ const { headers, handleClick } = useOutline()
22
20
  <div v-show="headers.length" ref="container">
23
21
  <div class="content">
24
22
  <div class="outline-title">
25
- {{ themeConfig.outlineTitle || t('sidebar.toc') }}
23
+ {{ t('theme.outlineTitle') }}
26
24
  </div>
27
25
 
28
26
  <div ref="marker" class="outline-marker" />
@@ -33,7 +31,7 @@ const { headers, handleClick } = useOutline()
33
31
  </span>
34
32
 
35
33
  <PressOutlineItem
36
- class="va-toc relative z-1"
34
+ class="va-toc relative z-1 css-i18n-toc"
37
35
  :headers="headers"
38
36
  :on-click="handleClick"
39
37
  root
@@ -17,10 +17,10 @@ const posts = computed(() => props.posts || site.postList)
17
17
 
18
18
  <template>
19
19
  <ul class="divide-y divide-gray-200">
20
- <Transition v-for="post, i in posts" :key="i" name="fade">
21
- <li class="py-12">
20
+ <TransitionGroup name="fade">
21
+ <li v-for="post, i in posts" :key="i" class="py-12">
22
22
  <PressArticleCard :post="post" />
23
23
  </li>
24
- </Transition>
24
+ </TransitionGroup>
25
25
  </ul>
26
26
  </template>
@@ -36,7 +36,7 @@ const localeTitle = computed(() => getLocaleTitle(locale.value, frontmatter.valu
36
36
  >
37
37
  <div class="container" flex="~ grow" justify="between">
38
38
  <slot name="main">
39
- <div class="content" w="full" :class="{ 'm-auto': !hasSidebar }" flex="~ col grow" p="lt-md:0">
39
+ <div class="vp-doc content" w="full" :class="{ 'm-auto': !hasSidebar }" flex="~ col grow" p="lt-md:0">
40
40
  <slot name="main-header" />
41
41
  <slot name="main-header-after" />
42
42
 
@@ -45,7 +45,7 @@ const localeTitle = computed(() => getLocaleTitle(locale.value, frontmatter.valu
45
45
  <ValaxyMd class="prose mx-auto w-full max-w-4xl" :frontmatter="frontmatter">
46
46
  <h1 v-if="hasSidebar && !isHome && frontmatter.title" :id="frontmatter.title" tabindex="-1">
47
47
  {{ localeTitle }}
48
- <a class="header-anchor" :href="`#${frontmatter.title}`" aria-hidden="true">#</a>
48
+ <a class="header-anchor" :href="`#${frontmatter.title}`" aria-hidden="true" />
49
49
  </h1>
50
50
  <slot name="main-content-md" />
51
51
  <slot />
@@ -4,7 +4,6 @@ import type { ThemeConfig } from '../types'
4
4
 
5
5
  /**
6
6
  * getThemeConfig
7
- * @returns
8
7
  */
9
8
  export function useThemeConfig<T = ThemeConfig>() {
10
9
  const config = useConfig<T>()
package/config/index.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  import type { ThemeConfig } from '../types'
2
2
 
3
- export const anonymousImage = 'https://cdn.yunyoujun.cn/img/avatar/none.jpg'
4
-
5
3
  /**
6
4
  * Default Config
7
5
  */
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" setup>
2
- import { useLayout, useSidebar } from 'valaxy'
2
+ import { asAny, useLayout, useSidebar } from 'valaxy'
3
3
 
4
4
  const { isOpen: isSidebarOpen, open: openSidebar, close: closeSidebar } = useSidebar()
5
5
  const layout = useLayout()
@@ -16,7 +16,7 @@ const layout = useLayout()
16
16
 
17
17
  <slot>
18
18
  <router-view v-slot="{ Component }">
19
- <component :is="Component">
19
+ <component :is="asAny(Component)">
20
20
  <template #main-header>
21
21
  <slot name="main-header" />
22
22
  </template>
package/layouts/post.vue CHANGED
@@ -1,3 +1,13 @@
1
+ <script setup lang="ts">
2
+ import { defineArticle, useSchemaOrg } from '@unhead/schema-org'
3
+
4
+ useSchemaOrg([
5
+ defineArticle({
6
+ '@type': 'Article',
7
+ }),
8
+ ])
9
+ </script>
10
+
1
11
  <template>
2
12
  <Layout>
3
13
  <PressArticle />
package/locales/en.yml ADDED
@@ -0,0 +1,4 @@
1
+ valaxy_theme_press: Valaxy Theme Press
2
+
3
+ theme:
4
+ outlineTitle: On this page
@@ -0,0 +1,4 @@
1
+ valaxy_theme_press: Valaxy 主题 Press
2
+
3
+ theme:
4
+ outlineTitle: 本页
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy-theme-press",
3
- "version": "0.0.4",
3
+ "version": "0.1.1",
4
4
  "description": "Docs Theme for Valaxy",
5
5
  "author": {
6
6
  "email": "me@yunyoujun.cn",
@@ -19,20 +19,10 @@
19
19
  "main": "node/index.ts",
20
20
  "types": "types/index.d.ts",
21
21
  "dependencies": {
22
- "@docsearch/css": "^3.3.3",
23
- "@docsearch/js": "^3.3.3"
22
+ "@docsearch/css": "^3.5.2",
23
+ "@docsearch/js": "^3.5.2"
24
24
  },
25
25
  "devDependencies": {
26
26
  "valaxy": "workspace:*"
27
- },
28
- "pnpm": {
29
- "peerDependencyRules": {
30
- "ignoreMissing": [
31
- "@algolia/client-search",
32
- "@types/react",
33
- "react",
34
- "react-dom"
35
- ]
36
- }
37
27
  }
38
28
  }
package/setup/main.ts CHANGED
@@ -1,6 +1,17 @@
1
1
  import { defineAppSetup } from 'valaxy'
2
2
  import { nextTick } from 'vue'
3
3
 
4
+ import 'vitepress/dist/client/theme-default/styles/vars.css'
5
+
6
+ // import 'vitepress/dist/client/theme-default/styles/base.css'
7
+ // import 'vitepress/dist/client/theme-default/styles/utils.css'
8
+ // import 'vitepress/dist/client/theme-default/styles/components/vp-code.css'
9
+ import 'vitepress/dist/client/theme-default/styles/components/vp-code-group.css'
10
+ import 'vitepress/dist/client/theme-default/styles/components/vp-doc.css'
11
+ import 'vitepress/dist/client/theme-default/styles/components/custom-block.css'
12
+
13
+ // import 'vitepress/dist/client/theme-default/styles/components/vp-sponsor.css'
14
+
4
15
  export default defineAppSetup((ctx) => {
5
16
  const { router, isClient } = ctx
6
17
  if (!isClient)
@@ -21,10 +21,6 @@
21
21
  text-decoration: none;
22
22
  border-bottom: 1px solid transparent;
23
23
  transition: all 0.4s;
24
-
25
- &:hover {
26
- // border-bottom-color: var(--va-c-brand);
27
- }
28
24
  }
29
25
 
30
26
  code:not(pre > code) {
package/tsconfig.json CHANGED
@@ -2,26 +2,26 @@
2
2
  // we need tsconfig.json to compile without
3
3
  // error: This is likely not portable. A type annotation is necessary.
4
4
  "compilerOptions": {
5
- "allowJs": true,
6
- "baseUrl": ".",
7
- "module": "ESNext",
8
5
  "target": "ESNext",
9
- "lib": ["DOM", "ESNext"],
10
- "strict": true,
11
- "esModuleInterop": true,
12
6
  "jsx": "preserve",
13
- "skipLibCheck": true,
7
+ "lib": ["DOM", "ESNext"],
8
+ "baseUrl": ".",
9
+ "module": "ESNext",
14
10
  "moduleResolution": "node",
15
11
  "resolveJsonModule": true,
16
- "noUnusedLocals": true,
17
- "strictNullChecks": true,
18
- "forceConsistentCasingInFileNames": true,
19
12
  "types": [
20
13
  "vite/client",
21
14
  "vue/ref-macros",
22
15
  "vite-plugin-pages/client",
23
16
  "vite-plugin-vue-layouts/client"
24
- ]
17
+ ],
18
+ "allowJs": true,
19
+ "strict": true,
20
+ "strictNullChecks": true,
21
+ "noUnusedLocals": true,
22
+ "esModuleInterop": true,
23
+ "forceConsistentCasingInFileNames": true,
24
+ "skipLibCheck": true
25
25
  },
26
26
  "exclude": ["**/dist/**", "node_modules"]
27
27
  }
package/types/index.d.ts CHANGED
@@ -5,8 +5,8 @@ export namespace PressTheme {
5
5
  export type Sidebar = any
6
6
 
7
7
  export interface Footer {
8
- message?: string;
9
- copyright?: string;
8
+ message?: string
9
+ copyright?: string
10
10
  }
11
11
 
12
12
  export interface SocialLink {
@@ -46,7 +46,6 @@ export namespace PressTheme {
46
46
  */
47
47
  primary: string
48
48
  }
49
-
50
49
 
51
50
  nav: Array<NavItem>
52
51
  sidebar: string[]
@@ -57,11 +56,7 @@ export namespace PressTheme {
57
56
 
58
57
  socialLinks: SocialLink[]
59
58
 
60
- // label
61
- /**
62
- * Toggle dark label
63
- */
64
- darkModeSwitchLabel?: string
59
+ lastUpdatedText?: string
65
60
  }
66
61
  }
67
62
 
@@ -78,8 +73,6 @@ export interface NavItemGroup {
78
73
 
79
74
  export type NavItem = NavItemLink | NavItemGroup
80
75
 
81
-
82
-
83
76
  /**
84
77
  * Theme Config
85
78
  */
package/utils/index.ts CHANGED
@@ -2,8 +2,7 @@
2
2
  * get locale title
3
3
  * @param locale
4
4
  * @param frontmatter
5
- * @returns
6
5
  */
7
6
  export function getLocaleTitle(locale: string, frontmatter: any) {
8
- return frontmatter[`title${locale === 'en' ? '' : `_${locale}`}`]
7
+ return frontmatter[`title${locale === 'en' ? '' : `_${locale}`}`] || frontmatter.title
9
8
  }
package/valaxy.config.ts CHANGED
@@ -32,11 +32,6 @@ export default defineTheme<ThemeConfig>((options) => {
32
32
  return {
33
33
  themeConfig: defaultThemeConfig,
34
34
  vite: {
35
- build: {
36
- rollupOptions: {
37
- external: ['valaxy-addon-algolia'],
38
- },
39
- },
40
35
  plugins: [ThemeVitePlugin(options)],
41
36
  },
42
37
  }
File without changes