Skip to content

Commit

Permalink
feat: custom home page component
Browse files Browse the repository at this point in the history
  • Loading branch information
reco_luan committed Oct 20, 2019
1 parent f4a1d1a commit d06f214
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions layouts/Layout.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<template>
<div>
<Common>
<Home v-if="$frontmatter.home && $themeConfig.type !== 'blog'"/>
<HomeBlog v-else-if="$frontmatter.home && $themeConfig.type === 'blog'"/>
<component v-if="$frontmatter.home" :is="homeCom"></component>
<Page
v-else
:sidebar-items="sidebarItems">
Expand Down Expand Up @@ -35,6 +34,13 @@ export default {
this.$site,
this.$localePath
)
},
homeCom () {
const { type } = this.$themeConfig
if (type !== undefined) {
return type == 'blog' ? 'HomeBlog': type
}
return 'Home'
}
}
}
Expand Down

0 comments on commit d06f214

Please sign in to comment.