This time I will show you how to use VuePress to build a personal blog, and what are the precautions for using VuePress to build a personal blog. The following is a practical case, let's take a look.
VuePress
Get started building
You can follow the examples in the document and play with it yourself. However, since VuePress documentation is also implemented using VuePress, I took a trick and directly used the docs directory in the VuePress warehouse to play with it. 1. First install VuePress globallynpm install -g vuepress
git clone git@github.com:docschina/vuepress.git
cd vuepress cd docs vuepress devWhen you see this line, it means you have succeeded:
VuePress dev server listening at http://localhost:8080/Next we open http://localhost:8080/ and find that the vuepress document is actually opened:
directory structure of docs:
├─.vuepress │ ├─components │ └─public │ └─icons │ └─config.js // 配置文件 ├─config // Vuepress文档的配置参考内容 ├─default-theme-config // Vuepress文档的默认主题配置内容 ├─guide // Vuepress文档的指南内容 └─zh // 中文文档目录 ├─config ├─default-theme-config └─guide └─README.md // 首页配置文件The document is divided into two For some parts, Chinese documents are in the /zh/ directory, and English documents are in the root directory. In fact, the things in the directory are quite easy to understand. First of all, the three directories guide, default-theme-config, and config are the main contents of the Vuepress document. From the Chinese document, we can also see that only These three directories were replaced.
Home page configuration
The default theme provides a home page layout. To use it, you need to set the YAML front of README.md in your root directory Specify home: true in matter and add some other metadata. Let’s take a look at the README in the root directory first, md:home: true // 是否使用Vuepress默认主题 heroImage: /hero.png // 首页的图片 actionText: Get Started → // 按钮的文字 actionLink: /guide/ // 按钮跳转的目录 features: // 首页三个特性 - title: Simplicity First details: Minimal setup with markdown-centered project structure helps you focus on writing. - title: Vue-Powered details: Enjoy the dev experience of Vue + webpack, use Vue components in markdown, and develop custom themes with Vue. - title: Performant details: VuePress generates pre-rendered static HTML for each page, and runs as an SPA once a page is loaded. footer: MIT Licensed | Copyright © 2018-present Evan You // 页尾I really can’t understand it. The official website has more detailed configuration instructions than me.
Navigation configuration
The navigation configuration file is in .vuepress/config.jsIn the navigation configuration file nav is To control the navigation bar link, you can change it to your own blog directory.nav: [ { text: 'Guide', link: '/guide/', }, { text: 'Config Reference', link: '/config/' }, { text: 'Default Theme Config', link: '/default-theme-config/' } ]The remaining default theme configuration official documents have very detailed
Documentation descriptionI won’t go into details here.
Change the default theme color
You can create an override.styl file in the .vuepress/ directory. vuepress provides four changeable colors:$accentColor = #3eaf7c // 主题色 $textColor = #2c3e50 // 文字颜色 $borderColor = #eaecef // 边框颜色 $codeBgColor = #282c34 // 代码背景颜色I changed it to this:
Implementation of Sidebar
Since there are many people asking in the comment area, I will update it here. In fact, no matter how detailed I write here, it is not as good as everyone reading the official document. . The sidebar configuration is also in .vuepress/config.js:sidebar: [ { title: 'JavaScript', // 侧边栏名称 collapsable: true, // 可折叠 children: [ '/blog/JavaScript/学会了ES6,就不会写出那样的代码', // 你的md文件地址 ] }, { title: 'CSS', collapsable: true, children: [ '/blog/CSS/搞懂Z-index的所有细节', ] }, { title: 'HTTP', collapsable: true, children: [ '/blog/HTTP/认识HTTP-Cookie和Session篇', ] }, ]Corresponding document structure:
├─blog // docs目录下新建一个博客目录 │ ├─CSS │ ├─HTTP │ └─JavaScriptMy blog: brownhu
Deployment
After configuring your blog, execute the command line:Vuepress build
When you see this line, it means success:
I believe you have mastered the method after reading the case in this article. Please pay attention for more exciting things. Other related articles on php Chinese website!
Recommended reading:
Node.js console output log file example analysis
How to use Vue to achieve drag and drop effect
The above is the detailed content of How to use VuePress to build a personal blog. For more information, please follow other related articles on the PHP Chinese website!

1、首先打开自己下载在手机中的企业微信软件。登录时,有两种方式可供选择:一种是使用微信号,另一种是使用手机号。3、这时候就需要企业管理员在后台添加了你的手机号,然后企业微信会根据你的手机号来进行企业的识别。然后显示你的企业,点击下方的进入企业选项。4、然后你就可以进入到软件中功能的使用,可以说最重要的就是必须你的手机号被管理员添加到企业中,不然是无法使用的。

Vue框架下,如何快速搭建统计图表系统在现代网页应用中,统计图表是必不可少的组成部分。Vue.js作为一款流行的前端框架,提供了很多便捷的工具和组件,能够帮助我们快速搭建统计图表系统。本文将介绍如何利用Vue框架以及一些插件来搭建一个简单的统计图表系统。首先,我们需要准备一个Vue.js的开发环境,包括安装Vue脚手架以及一些相关的插件。在命令行中执行以下命

玩家在雾锁王国中进行游戏时可以收集不同的材料用来建造建筑,有很多玩家想知道野地搭建筑吗,雾锁王国能野地是不能搭建筑的,必须要在祭坛的范围内才可以搭建。雾锁王国能野地搭建筑吗答:不能。1、雾锁王国能野地是不能搭建筑的。2、建筑必须要在祭坛的范围内才可以搭建。3、玩家可以自行放置灵火祭坛,但一旦离开了范围,将无法进行建筑搭建。4、我们也可以直接在山上挖个洞当做我们的家,这样不用耗建筑材料。5、玩家自己搭建的建筑中,存在舒适度机制,也就是说,内饰越好,舒适度越高。6、高舒适度将为玩家带来属性加成,例如

CentOS7下搭建web服务器的网络安全加固技巧web服务器是现代互联网的重要组成部分,因此保护web服务器的安全性非常重要。通过加固网络安全,可以减少风险和避免潜在的攻击。本文将介绍在CentOS7上搭建web服务器时常用的网络安全加固技巧,并提供相应的代码示例。更新系统和软件首先,确保你的系统和软件是最新版本。可以使用以下命令更

在当下信息充斥的时代,社交媒体平台已经成为人们获取和分享信息的主要途径。对于个人和企业而言,建立一个有效的账号网络以实现信息的最大传播和提升影响力,已成为亟需解决的挑战。一、账号矩阵怎么搭建?1.明确目标人群在构建账号矩阵之前,关键是明确目标受众,深入了解他们的需求、兴趣和消费习惯,这样才能制定更具针对性的内容策略。2.选择合适的平台根据目标人群的特点,选择适合的社交媒体平台进行布局。目前主流的社交媒体平台有微博、微信、抖音、快手等,每个平台都有其独特的用户群体和传播特点,需要根据实际情况进行选

PyTorch安装指南:在PyCharm中快速搭建开发环境PyTorch是当前深度学习领域中备受欢迎的框架之一,具有易用性和灵活性的特点,深受开发者青睐。本文将为大家介绍如何在PyCharm中快速搭建PyTorch的开发环境,方便大家开始深度学习项目的开发。步骤一:安装PyTorch首先,我们需要安装PyTorch。PyTorch的安装通常需要考虑到系统环境

CentOS搭建web服务器的日志管理与监控技巧Web服务器是现代互联网应用的重要组成部分,而服务器的日志管理与监控是确保服务器稳定运行和故障排查的关键。本文将介绍在CentOS操作系统上如何搭建web服务器,并提供一些日志管理与监控的技巧。一、搭建Web服务器安装ApacheApache是一个流行的开源Web服务器软件。在CentOS上安装Apache很简

随着移动互联网的快速发展,短视频应用抖音已经成为人们日常生活中不可或缺的一部分。拥有一个高人气的抖音账号,不仅能吸引粉丝关注,还能带来商业价值。那么,如何搭建一个最好的抖音账号呢?一、抖音账号怎么搭建最好?1.定位清晰在创建抖音账号之初,首先要明确自己的定位。你是想成为搞笑幽默的段子手,还是专业知识分享者?明确定位有助于吸引精准粉丝,从而增加账号的价值。2.账号命名一个好的账号名字能让粉丝一眼记住你。账号名字应简洁明了,与自己的定位相关,同时具有一定的创意。避免使用过于常见的名字,以免与他人混淆


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

Notepad++7.3.1
Easy-to-use and free code editor

Atom editor mac version download
The most popular open source editor

WebStorm Mac version
Useful JavaScript development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment
