Skip to content

Commit f35ff82

Browse files
authored
build: initial build setup and layouts (#1)
* npm devDependencies, config and build scripts * update README * example content * Layout and Collection layout and initial components
1 parent 249ce29 commit f35ff82

File tree

17 files changed

+15540
-2
lines changed

17 files changed

+15540
-2
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.eslintrc.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
module.exports = {
2+
root: true,
3+
4+
env: {
5+
node: true,
6+
jest: true,
7+
},
8+
9+
extends: [
10+
'plugin:vue/recommended',
11+
'plugin:prettier/recommended',
12+
'prettier/vue',
13+
],
14+
15+
parserOptions: {
16+
parser: 'babel-eslint', // Support dynamic import
17+
},
18+
19+
rules: {
20+
'no-undef': ['error'],
21+
22+
'vue/match-component-file-name': [
23+
'error',
24+
{
25+
extensions: ['js', 'vue'],
26+
shouldMatchCase: false,
27+
},
28+
],
29+
30+
'vue/prop-name-casing': 0,
31+
32+
'vue/require-default-prop': 0,
33+
},
34+
}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
.temp
3+
dist

.prettierrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
semi:false,
3+
singleQuote: true,
4+
tabWidth: 2,
5+
trailingComma: 'es5',
6+
}

README.md

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,60 @@
1-
# vuepress-theme-base
2-
If you want to create your own VuePress theme, fork this repo!
1+
# vuepress-theme-base (WIP)
2+
3+
> Create your own VuePress themes
4+
5+
**Note: this is work in progress - please watch for releases**
6+
7+
## Aims
8+
9+
Building themes from scratch can be daunting. Overriding a default theme can be limiting.
10+
11+
The aim of this theme is to provide a starter kit for designers and developers who want to create their own VuePress themes.
12+
13+
### This theme will include:
14+
15+
- a starter set of layouts and components that output accessible, semantic html
16+
- the best tooling to help you develop, test and publish quality themes
17+
- example content so that you can try out your theme
18+
- no styles - styling is up to you!
19+
20+
## Usage
21+
22+
There are three options for using this theme:
23+
24+
1. [Just add styles](#option-1-just-add-styles) for your website
25+
2. [Use as a parent theme](#option-2-use-as-a-parent-theme) for your own website theme
26+
3. [Fork this repo](#option-3-fork-and-develop-your-own-themes) to create and share your own VuePress themes.
27+
28+
### Option 1: Just add styles
29+
30+
If you only need to add styles for a one-off website, you can do that in your `.vuepress/styles/index.styl` file.
31+
32+
### Option 2: Use as a parent theme
33+
34+
If you are developing a one-off theme for your site, you can install this theme and then override layouts and components in your own `.vuepress/theme` folder.
35+
36+
### Option 3: Fork and develop your own themes
37+
38+
1. Fork this repo
39+
2. Rename your repo and edit the README and package.json files to describe you new theme
40+
3. Clone your repo to your computer and start making changes
41+
4. Run `npm start` to see your theme with the example content
42+
5. Run `npm test` to test your theme
43+
6. When you are happy with your theme, publish it to NPM so that it can be installed in any VuePress site
44+
45+
This is what this theme was made for - every time I want to create and publish a new theme, I use a fork of this theme as a starting point.
46+
47+
## Layouts
48+
49+
This theme will have the following layouts:
50+
51+
- Layout
52+
- Blog
53+
- Article
54+
- 404
55+
56+
## Components
57+
58+
- Header
59+
- Footer
60+
- Collection

example/.vuepress/config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
title: 'Example Website',
3+
description: 'An example website built with vuepress-theme-base',
4+
theme: require.resolve('../../theme'),
5+
}

example/blog/index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
layout: Collection
3+
---
4+
5+
# Blog

example/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Home
3+
---
4+
5+
# Homepage test
6+
7+
This will update automatically on save!

0 commit comments

Comments
 (0)