Skip to content

Commit

Permalink
feat: add vuepress
Browse files Browse the repository at this point in the history
  • Loading branch information
vinayakkulkarni committed Aug 18, 2020
1 parent d89aca0 commit 9001414
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 0 deletions.
11 changes: 11 additions & 0 deletions prompts.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,15 @@ module.exports = [
filter: (val) => val.toLowerCase(),
store: true,
},
{
name: 'docs',
message: 'Would you like to write docs?',
type: 'list',
pageSize: 10,
choices: [
{ name: 'VuePress', value: 'vuepress' },
{ name: "I don't write docs", value: false },
],
default: false,
},
];
9 changes: 9 additions & 0 deletions saofile.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ module.exports = {
},
];

// user wants Vuepress for hosting docs
if (this.answers.docs !== false) {
actions.push({
type: 'add',
files: '**',
templateDir: 'template/features/docs',
});
}

return actions;
},
async completed() {
Expand Down
7 changes: 7 additions & 0 deletions template/base/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
"lint:eslint:fix": "eslint --fix \"{,!(node_modules|dist)/**/}*.{js,vue}\"",
"lint:prettier": "prettier --check \"{,!(node_modules|dist)/**/}*.{js,vue}\"",
"lint:prettier:fix": "prettier --write \"{,!(node_modules|dist)/**/}*.{js,vue}\"",
<%_ if (docs === 'vuepress') { _%>
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs",
<%_ } _%>
"release:prepare": "shipjs prepare",
"release:trigger": "shipjs trigger"
},
Expand Down Expand Up @@ -62,6 +66,9 @@
"rollup-plugin-vue": "^5.1.6",
"shipjs": "^0.20.1",
"vue": "^2.6.11",
<%_ if (docs === 'vuepress') { _%>
"vuepress": "^1.5.3",
<%_ } _%>
"vue-template-compiler": "^2.6.11"
},
"bugs": {
Expand Down
30 changes: 30 additions & 0 deletions template/features/docs/docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module.exports = {
title: '<%= name %>',
description: '<%= description %>',
themeConfig: {
sidebar: {
'/': [
['', '<%= name %>'],
],
},
nav: [{ text: 'Home', link: '/' }],
theme: '@vuepress/theme-default',
searchPlaceholder: 'Search...',
lastUpdated: 'Last Updated', // string | boolean
// Smooth Scrolling
smoothScroll: true,
// if your docs are not at the root of the repo:
docsDir: 'docs',
// defaults to false, set to true to enable
editLinks: true,
// custom text for edit link. Defaults to "Edit this page"
editLinkText: 'Help us improve this page!',
},
configureWebpack: {
resolve: {
alias: {
'@': '../src/',
},
},
},
};
16 changes: 16 additions & 0 deletions template/features/docs/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
home: true
heroImage: https://placehold.it/1000x1000
heroText: <%= name %>
tagline: <%= description %>
actionText: Get Started →
actionLink: /
features:
- title: Future Proof 🚀
details: Written in Vue 3
- title: Easy to use 👨‍🔧
details: Easy to integrate in your existing Vue App
- title: Tree shakable 🌳
details: Only load components you want
footer: MIT Licensed | Copyright © 2020-present <%= fullname %>
---

0 comments on commit 9001414

Please sign in to comment.