Overview:
This article discusses the use of Vuepress to build a theme. It includes information about updates, such as changes to the comment style and default language, the addition of a back-to-top feature, modifications to the article directory logic and style, changes to the article title display style, and the addition of a rotating avatar and GitHub comment functionality. It also mentions bug fixes and the official release of version 1.0.0 on npm. The article provides a guide on how to install the theme and write blog articles using Vuepress. It concludes with instructions on how to deploy the theme.
Features:
- Comment Style and Default Language: The theme has a modified comment style and supports multiple languages.
- Back-to-Top Functionality: The theme includes a feature that allows users to quickly navigate back to the top of the page.
- Article Directory: The theme implements logic and style changes to the article directory, making it easier to navigate.
- Modified Article Title Display: The theme has a new style for displaying article titles.
- Rotating Avatar: The theme includes a small animation of a rotating avatar.
- GitHub Comment Functionality: Users can leave comments using GitHub.
- Bug Fixes: The theme addresses issues such as incomplete title displays for long article directories and a bug related to excessive categorization.
- Customizable Personal Information: The theme allows customization of personal information, including the option to display a QR code for WeChat.
Installation:
To get started, make sure you have Vuepress installed globally. Then, follow these steps:
- Create a folder named “my-blog” anywhere on your computer.
- Navigate to that folder in the command line.
- Install Vuepress by running the following command:
npm install -g vuepress
- Create the basic directory structure for your project.
- Add the following code snippet to your project’s package.json file:
"scripts": {
"dev": "vuepress dev docs",
"build": "vuepress build docs"
}
- Copy the configuration file (config.js) provided in the article and paste it into your project’s docs/.vuepress/ directory.
- Customize the configuration file according to your needs.
- Start writing your blog posts in the docs/blogs directory. Each post should be written in Markdown format and include the following information at the beginning:
title: [Article Title]
category: [Article Category]
desc: [Article Description]
tag: [Article Tags]
picture: [Article Thumbnail]
thumbnaildate: [Publication Date]
Update: [Update Date]
- After adding your articles, run the command
yarn devornpm run devin the command line to start the preview. - To deploy your theme, run
vuepress build docsin the command line. This will generate a “dist” folder in the .vuepress directory, containing all HTML, CSS, JS, and static files. You can then deploy this folder.
Summary:
This article provides details on how to build a theme using Vuepress. It covers various features and updates implemented in the theme, such as modified comment styles, back-to-top functionality, changes to the article directory logic and display, and the addition of a rotating avatar and GitHub comment functionality. The article also includes a guide on how to install the theme, configure it, and write blog articles using Markdown. It concludes with instructions on deploying the theme.