Skip to content

Commit

Permalink
fix(default-theme): use description as tagline by default
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Sep 8, 2021
1 parent 96bcdda commit b94c827
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/client/theme-default/components/HomeHero.vue
Expand Up @@ -6,17 +6,15 @@ import NavLink from './NavLink.vue'
const { site, frontmatter } = useData()
const showHero = computed(() => {
const {
heroImage,
heroText,
tagline,
actionLink,
actionText
} = frontmatter.value
const { heroImage, heroText, tagline, actionLink, actionText } =
frontmatter.value
return heroImage || heroText || tagline || (actionLink && actionText)
})
const heroText = computed(() => frontmatter.value.heroText || site.value.title)
const tagline = computed(
() => frontmatter.value.tagline || site.value.description
)
</script>

<template>
Expand All @@ -30,9 +28,7 @@ const heroText = computed(() => frontmatter.value.heroText || site.value.title)
</figure>

<h1 v-if="heroText" id="main-title" class="title">{{ heroText }}</h1>
<p v-if="frontmatter.tagline" class="description">
{{ frontmatter.tagline }}
</p>
<p v-if="tagline" class="tagline">{{ tagline }}</p>

<NavLink
v-if="frontmatter.actionLink && frontmatter.actionText"
Expand Down Expand Up @@ -99,7 +95,7 @@ const heroText = computed(() => frontmatter.value.heroText || site.value.title)
}
}
.description {
.tagline {
margin: 0;
margin-top: 0.25rem;
line-height: 1.3;
Expand All @@ -108,7 +104,7 @@ const heroText = computed(() => frontmatter.value.heroText || site.value.title)
}
@media (min-width: 420px) {
.description {
.tagline {
line-height: 1.2;
font-size: 1.6rem;
}
Expand Down

0 comments on commit b94c827

Please sign in to comment.