Skip to content

Commit

Permalink
feat: add support for hosting vuepress docs on netlify
Browse files Browse the repository at this point in the history
  • Loading branch information
vinayakkulkarni committed Aug 18, 2020
1 parent 9001414 commit 6a1ed22
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
12 changes: 12 additions & 0 deletions prompts.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,16 @@ module.exports = [
],
default: false,
},
{
when: (answers) => answers.docs !== false,
name: 'netlify',
message: 'Would you like deploy docs on netlify?',
type: 'list',
pageSize: 10,
choices: [
{ name: 'Yes', value: true },
{ name: 'Not needed', value: false },
],
default: false,
},
];
8 changes: 8 additions & 0 deletions saofile.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ module.exports = {
files: '**',
templateDir: 'template/features/docs',
});
// If user wants to deploy vuepress docs on
if (this.answers.netlify !== false) {
actions.push({
type: 'add',
files: '**',
templateDir: 'template/features/netlify',
});
}
}

return actions;
Expand Down
6 changes: 6 additions & 0 deletions template/features/netlify/netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[dev]
command = "npm run docs:dev"

[build]
command = "npm run docs:build"
publish = "docs/.vuepress/dist"

0 comments on commit 6a1ed22

Please sign in to comment.