diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67fcc23..5c789cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,33 +43,33 @@ jobs: # run: pnpm run typecheck # check windows build - build: - runs-on: ${{ matrix.os }} + # build: + # runs-on: ${{ matrix.os }} - strategy: - matrix: - node-version: [16.x] - os: [ubuntu-latest, windows-latest] - fail-fast: false + # strategy: + # matrix: + # node-version: [16.x] + # os: [ubuntu-latest, windows-latest] + # fail-fast: false - steps: - - uses: actions/checkout@v3 + # steps: + # - uses: actions/checkout@v3 - - name: Install pnpm - uses: pnpm/action-setup@v2 + # - name: Install pnpm + # uses: pnpm/action-setup@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - registry-url: https://registry.npmjs.org/ - cache: pnpm + # - name: Use Node.js ${{ matrix.node-version }} + # uses: actions/setup-node@v3 + # with: + # node-version: ${{ matrix.node-version }} + # registry-url: https://registry.npmjs.org/ + # cache: pnpm - - name: Install - run: pnpm install + # - name: Install + # run: pnpm install - - name: Build - run: pnpm run build + # - name: Build + # run: pnpm run build - - name: Build:demo - run: pnpm run build:demo + # - name: Build:demo + # run: pnpm run build:demo diff --git a/theme/components/ShokaxPostCopyright.vue b/theme/components/ShokaxPostCopyright.vue index 504ed85..58ce254 100644 --- a/theme/components/ShokaxPostCopyright.vue +++ b/theme/components/ShokaxPostCopyright.vue @@ -1,11 +1,14 @@ diff --git a/theme/components/ShokaxPostFooter.vue b/theme/components/ShokaxPostFooter.vue new file mode 100644 index 0000000..0d726d2 --- /dev/null +++ b/theme/components/ShokaxPostFooter.vue @@ -0,0 +1,25 @@ + + + diff --git a/theme/components/ShokaxPostNav.vue b/theme/components/ShokaxPostNav.vue new file mode 100644 index 0000000..d75f438 --- /dev/null +++ b/theme/components/ShokaxPostNav.vue @@ -0,0 +1,17 @@ + + + diff --git a/theme/components/ShokaxPostNavBlock.vue b/theme/components/ShokaxPostNavBlock.vue new file mode 100644 index 0000000..f595780 --- /dev/null +++ b/theme/components/ShokaxPostNavBlock.vue @@ -0,0 +1,38 @@ + + + diff --git a/theme/composables/config.ts b/theme/composables/config.ts index 93145d7..fc4ff0b 100644 --- a/theme/composables/config.ts +++ b/theme/composables/config.ts @@ -1,4 +1,5 @@ import { computed } from 'vue' +import type { Post } from 'valaxy' import { useConfig } from 'valaxy' import type { ThemeConfig } from '../types' @@ -9,3 +10,11 @@ export function useThemeConfig() { const config = useConfig() return computed(() => config!.value.themeConfig) } + +export function getCover(post: Post) { + const covers = useConfig().value.themeConfig.covers + if (post.cover) + return post.cover + else if (covers.length >= 1) + return covers[0] +} diff --git a/theme/node/index.ts b/theme/node/index.ts index a74b6a2..f112b25 100644 --- a/theme/node/index.ts +++ b/theme/node/index.ts @@ -35,6 +35,9 @@ export const defaultThemeConfig: ThemeConfig = { atom: false, }, author: 'Anyone', + covers: [ + 'https://example.com', + ], } // write a vite plugin diff --git a/theme/types/index.d.ts b/theme/types/index.d.ts index 0cbc726..d8c0172 100644 --- a/theme/types/index.d.ts +++ b/theme/types/index.d.ts @@ -71,6 +71,8 @@ export interface ThemeConfig { rss: boolean atom: boolean } + + covers: string[] } export interface NavItem {