feat: add tagline

This commit is contained in:
reco_luan 2020-03-15 19:37:40 +08:00
parent 0a3fdb85d8
commit 9ce2a3806b
4 changed files with 16 additions and 28 deletions

View File

@ -9,10 +9,12 @@
alt="hero"> alt="hero">
</ModuleTransition> </ModuleTransition>
<ModuleTransition delay="0.04"> <ModuleTransition delay="0.04">
<h1 v-if="recoShowModule && $frontmatter.isShowTitleInHome !== false">{{ $frontmatter.heroText || $title || '午后南杂' }}</h1> <h1 v-if="recoShowModule && $frontmatter.heroText !== null">{{ $frontmatter.heroText || $title || 'vuePress-theme-reco' }}</h1>
</ModuleTransition> </ModuleTransition>
<ModuleTransition delay="0.08"> <ModuleTransition delay="0.08">
<p v-show="recoShowModule" class="description">{{ $description || 'Welcome to your vuePress-theme-reco site' }}</p> <p v-if="recoShowModule && $frontmatter.tagline !== null" class="description">
{{ $frontmatter.tagline || $description || 'Welcome to your vuePress-theme-reco site' }}
</p>
</ModuleTransition> </ModuleTransition>
<ModuleTransition delay="0.16"> <ModuleTransition delay="0.16">
<p class="huawei" v-if="recoShowModule && $themeConfig.huawei === true"> <p class="huawei" v-if="recoShowModule && $themeConfig.huawei === true">

View File

@ -13,12 +13,14 @@
alt="hero"> alt="hero">
</ModuleTransition> </ModuleTransition>
<ModuleTransition delay="0.04"> <ModuleTransition delay="0.04">
<h1 v-if="$frontmatter.isShowTitleInHome !== false">{{ $frontmatter.heroText || $title || '午后南杂' }}</h1> <h1 v-if="recoShowModule && $frontmatter.heroText !== null">
{{ $frontmatter.heroText || $title || 'vuePress-theme-reco' }}
</h1>
</ModuleTransition> </ModuleTransition>
<ModuleTransition delay="0.08"> <ModuleTransition delay="0.08">
<p v-show="recoShowModule" class="description"> <p v-if="recoShowModule && $frontmatter.tagline !== null" class="description">
{{ $description || 'Welcome to your vuePress-theme-reco site' }} {{ $frontmatter.tagline || $description || 'Welcome to your vuePress-theme-reco site' }}
</p> </p>
</ModuleTransition> </ModuleTransition>

View File

@ -1,22 +1,18 @@
<template> <template>
<main class="page"> <main class="page">
<ModuleTransition> <ModuleTransition>
<slot v-show="recoShowModule" name="top"/> <div v-show="recoShowModule && $page.title" class="page-title">
</ModuleTransition>
<ModuleTransition delay="0.08">
<div v-show="recoShowModule" class="page-title">
<h1>{{$page.title}}</h1> <h1>{{$page.title}}</h1>
<hr> <hr>
<PageInfo :pageInfo="$page" :showAccessNumber="showAccessNumber"></PageInfo> <PageInfo :pageInfo="$page" :showAccessNumber="showAccessNumber"></PageInfo>
</div> </div>
</ModuleTransition> </ModuleTransition>
<ModuleTransition delay="0.16"> <ModuleTransition delay="0.08">
<Content v-show="recoShowModule" class="theme-reco-content" /> <Content v-show="recoShowModule" class="theme-reco-content" />
</ModuleTransition> </ModuleTransition>
<ModuleTransition delay="0.24"> <ModuleTransition delay="0.16">
<footer v-show="recoShowModule" class="page-edit"> <footer v-show="recoShowModule" class="page-edit">
<div <div
class="edit-link" class="edit-link"
@ -40,7 +36,7 @@
</footer> </footer>
</ModuleTransition> </ModuleTransition>
<ModuleTransition delay="0.32"> <ModuleTransition delay="0.24">
<div class="page-nav" v-if="recoShowModule && (prev || next)"> <div class="page-nav" v-if="recoShowModule && (prev || next)">
<p class="inner"> <p class="inner">
<span <span
@ -72,10 +68,6 @@
</p> </p>
</div> </div>
</ModuleTransition> </ModuleTransition>
<ModuleTransition delay="0.40">
<slot v-show="recoShowModule" name="bottom"/>
</ModuleTransition>
</main> </main>
</template> </template>
@ -99,6 +91,7 @@ export default {
computed: { computed: {
showAccessNumber () { showAccessNumber () {
console.log(this)
return this.$themeConfig.commentsSolution === 'valine' return this.$themeConfig.commentsSolution === 'valine'
}, },
lastUpdated () { lastUpdated () {

View File

@ -1,17 +1,8 @@
<template> <template>
<div> <div>
<Common> <Common>
<component v-if="$frontmatter.home" :is="homeCom"></component> <component v-if="$frontmatter.home" :is="homeCom"/>
<Page <Page v-else :sidebar-items="sidebarItems"/>
v-else
:sidebar-items="sidebarItems">
<slot
name="page-top"
slot="top"/>
<slot
name="page-bottom"
slot="bottom"/>
</Page>
<Footer v-if="$frontmatter.home" class="footer" /> <Footer v-if="$frontmatter.home" class="footer" />
</Common> </Common>
</div> </div>