Skip to content

Commit

Permalink
fix(theme): incorrect article copyright, close #362 (#363)
Browse files Browse the repository at this point in the history
  • Loading branch information
pengzhanbo authored Nov 27, 2024
1 parent de2a5a3 commit 6533332
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions theme/src/client/components/VPDocCopyright.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script setup lang="ts">
import type { CopyrightFrontmatter } from '../../shared/index.js'
import type { CopyrightFrontmatter, CopyrightOptions } from '../../shared/index.js'
import VPCopyright from '@theme/VPCopyright.vue'
import VPDocHeader from '@theme/VPDocHeader.vue'
import { computed } from 'vue'
import { isPlainObject } from 'vuepress/shared'
import { useData } from '../composables/index.js'
const { theme, frontmatter } = useData()
const { theme, frontmatter } = useData<'post'>()
const copyright = computed<CopyrightFrontmatter | null>(() => {
if ((frontmatter.value.copyright ?? theme.value.copyright ?? false) === false) {
Expand All @@ -20,12 +20,11 @@ const copyright = computed<CopyrightFrontmatter | null>(() => {
const themeCopyright = (isPlainObject(theme.value.copyright)
? theme.value.copyright
: { license: theme.value.copyright === true ? '' : theme.value.copyright }) as CopyrightFrontmatter
: { license: theme.value.copyright === true ? undefined : theme.value.copyright }) as CopyrightOptions
return {
...themeCopyright,
...docCopyright,
}
docCopyright.license ??= themeCopyright.license
return docCopyright
})
</script>

Expand Down

0 comments on commit 6533332

Please sign in to comment.