chore: handle fm aside and outline for outline

userquin/feat-add-print-options
userquin 2 years ago
parent 7380e36691
commit d58d3b44b4

@ -5,11 +5,13 @@ import { computed } from 'vue'
export function useScreenOnly(entry: keyof DefaultTheme.PrintOptions) { export function useScreenOnly(entry: keyof DefaultTheme.PrintOptions) {
const { theme, frontmatter } = useData() const { theme, frontmatter } = useData()
return computed( // we have aside and outline in frontmatter, we will check for both for outline
() => return computed(() =>
frontmatter.value[entry] === false || entry === 'outline'
theme.value.print === false || ? frontmatter.value.aside === false || frontmatter.value.outline === false
(typeof theme.value.print === 'object' && : frontmatter.value[entry] === false ||
theme.value.print[entry] === false) theme.value.print === false ||
(typeof theme.value.print === 'object' &&
theme.value.print[entry] === false)
) )
} }

Loading…
Cancel
Save