360 Secure SkillHub
360 安全技能中心

VitePress Generator

该助手可协助用户基于VitePress快速生成静态网站,核心功能涵盖Node.js环境检查、项目创建、依赖安装、目录结构初始化、脚本配置、本地预览、生产构建及部署指导。典型使用场景包括创建技术文档站、项目文档、个人博客等,输出清晰的命令操作指引及关键注意事项。

openlark
openlark
热度 48.55
最近更新 2026-05-11 17:35:07
分类:开发依赖:代码执行 / 读写文件应用场景:代码生成 / DevOps / 模板 / 博客写作

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add vitepress-generator
Metadata
name
vitepress-generator
description
Quickly generate static websites using VitePress. Supports installing dependencies, initializing projects, local preview, building, and deployment.

VitePress Static Website Generator

Feature Overview

Quickly generate static websites using VitePress. Supports installing dependencies, initializing projects, local preview, building, and deployment.

Trigger Scenarios

  • User mentions "static website", "documentation site", "generate website", "build documentation", "create blog", "VitePress", "vitepress", "vuepress", "documentation site", "technical documentation", "project documentation", "personal blog", etc.

Quick Start

When users need to create a static website, follow the process below:

1. Check Environment

First, confirm that the user has Node.js installed:

node -v
npm -v

If not installed, prompt the user to install Node.js first (v18+ recommended).

2. Create Project Directory

mkdir <project-name>
cd <project-name>
npm init -y

3. Install VitePress

npm add -D vitepress

4. Initialize Project Structure

Create the basic directory structure:

<project-name>/
├── docs/
│   ├── .vitepress/
│   │   └── config.mts
│   ├── index.md
│   └── guide/
│       └── getting-started.md
├── package.json
└── README.md

5. Configure Scripts

Add the following to package.json:

{
  "scripts": {
    "docs:dev": "vitepress dev docs",
    "docs:build": "vitepress build docs",
    "docs:preview": "vitepress preview docs"
  }
}

6. Local Preview

npm run docs:dev

Default access: http://localhost:5173

7. Build

npm run docs:build

Output directory: docs/.vitepress/dist/

Complete Configuration Reference

For detailed configuration options, see references/config-guide.md

Theme Customization

For custom themes and styles, see references/theme-customization.md

Deployment Guide

For deployment to different platforms, see references/deployment.md

Quick Command Reference

Command Description
npm run docs:dev Start local development server
npm run docs:build Build production version
npm run docs:preview Preview build results

Important Notes

  1. Node.js Version: Requires v18 or higher
  2. Port Usage: Development server uses port 5173 by default
  3. Build Output: Build artifacts are located in docs/.vitepress/dist/ directory
  4. Config Files: Supports .mts, .ts, .mjs, .js formats