- 开发无止境 -
Data: 2016-07-28 11:14:29Form: JournalClick: 11
// config.js 文件
module.exports = {
theme: 'vuepress-theme-xx'
}
// config.js 文件
module.exports = {
theme: 'xxx'
}
@vuepress/theme-
开头的主题是官方维护的主题。blog
目录├── docs
├── blog
│ ├── _posts (存储您的帖子内容)
│ │ ├── 2018-11-7-frontmatter-in-vuepress.md
│ │ ├── 2019-2-26-markdown-slot.md
│ │ └── 2019-5-6-writing-a-vuepress-theme.md
│ └── .vuepress
│ ├── `components` (可选的)
│ ├── `public` (可选的)
│ ├── `styles` (可选的)
│ │ ├── index.styl
│ │ └── palette.styl
│ ├── config.js
│ └── `enhanceApp.js` (可选的)
└── package.json
yarn add @vuepress/theme-blog -D
# OR npm install @vuepress/theme-blog -D
config.js
文件module.exports = {
title: "欧阳克个人博客",
theme: "@vuepress/theme-blog",
themeConfig: {},
};
// package.json
"scripts": {
"dev": "vuepress dev blog",
"build": "vuepress build blog"
}
yarn dev
# npm run dev
_posts/1.md
目录和文件# VuePress
- 官网:https://www.vuepress.cn
- `VuePress` 是 `Vue` 驱动的静态网站生成器
---
## 一、介绍
- 简洁至上
- 以 Markdown 为中心的项目结构,以最少的配置帮助你专注于写作。
- `Vue` 驱动
- 享受 `Vue` + `webpack` 的开发体验,可以在 `Markdown` 中使用 `Vue` 组件,又可以使用 `Vue` 来开发自定义主题。
- 高性能
- `VuePress` 会为每个页面预渲染生成静态的 `HTML`,同时,每个页面被加载的时候,将作为 `SPA` 运行。
---
## 二、安装 `Node.js`
- `VuePress` 需要 `Node.js` >= 8.6
- 官网:https://nodejs.org
---
## 三、安装 `VuePress`
### 1、创建并进入一个新目录
```php
mkdir vuepress-starter && cd vuepress-starter
```
### 2、包管理器进行初始化
```php
yarn init # npm init
```
```php
# 项目名称
question name (vuepress):
# 项目版本
question version (1.0.0):
# 项目描述
question description:
# 项目入口
question entry point (index.js):
# 项目存储库,如:git
question repository url:
# 项目作者
question author:
# 项目许可证
question license (MIT):
# 项目私有属性
question private:
```
- 根目录会新建一个文件:package.json
### 3、将 `VuePress` 安装为本地依赖
```php
yarn add -D vuepress # npm install -D vuepress
yarn global add vuepress # 或者:npm install -g vuepress
```
### 4、新建目录和文件
```php
mkdir docs && echo '# Hello VuePress' > docs/README.md
```
### 5、`package.json` 添加配置
```php
{
"scripts": {
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs"
}
}
```
### 6、本地启动服务器
```php
yarn docs:dev # npm run docs:dev
```
---
title: VuePress
date: 2021-06-18
author: 欧阳克
location: He Fei
---
tags
---
title: VuePress
date: 2021-06-18
author: 欧阳克
location: He Fei
tags:
- VuePress
- Vue
---