Skip to content

Commit

Permalink
feat: add default document title and meta description (#556)
Browse files Browse the repository at this point in the history
* feat: add default title and description meta

* fix: remove default title description setting
  • Loading branch information
wuxinhua authored and egoist committed Nov 11, 2019
1 parent 344fa3e commit 54b5e9a
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions packages/saber/vue-app/create-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,29 @@ export default context => {
if (!htmlAttrs.lang) {
delete htmlAttrs.lang
}

const { title, description } = this.$siteConfig

const defaultMeta = [
{
name: 'generator',
content: `Saber v${__SABER_VERSION__}`
}
]

if (description) {
defaultMeta.push({
name: 'description',
content: description
})
}

return {
...head,
htmlAttrs,
title,
meta: [
{
name: 'generator',
content: `Saber v${__SABER_VERSION__}`
},
...defaultMeta,
...(head.meta || [])
]
}
Expand Down

0 comments on commit 54b5e9a

Please sign in to comment.