诚城的成长 诚城的成长
首页
  • 高数基础
  • 数一

    • 高等数学
    • 线性代数
    • 概率论与数理统计
  • 820

    • 数据结构
    • 计算机操作系统
  • 英一

    • 单词
    • 语法
    • 阅读理解
    • 作文
  • 政治

    • 马克思主义基本原理
    • 毛泽东
    • 近代史
    • 思修
    • 时事
  • openpose
  • html5
  • css3
  • UI

    • Tailwind Css
    • Element-Plus
    • UniApp
  • 框架

    • Vue3
  • 拓展包

    • 包管理工具
    • 包开发
  • 开发语言

    • C语言
    • PHP
    • Phyton
  • 框架

    • Laravel
  • 会计

    • 初级经济法基础
    • 初级会计实务
  • 软考

    • 信息系统项目管理师
  • 博客

    • vitepress
    • vuepress
  • manim
  • git
  • vsCode
  • latex
  • docker
  • axios
  • vim
  • mac
  • Jetbrains

    • phpstorm
    • clion
突发奇想
GitHub (opens new window)

诚城

我有N个梦想……
首页
  • 高数基础
  • 数一

    • 高等数学
    • 线性代数
    • 概率论与数理统计
  • 820

    • 数据结构
    • 计算机操作系统
  • 英一

    • 单词
    • 语法
    • 阅读理解
    • 作文
  • 政治

    • 马克思主义基本原理
    • 毛泽东
    • 近代史
    • 思修
    • 时事
  • openpose
  • html5
  • css3
  • UI

    • Tailwind Css
    • Element-Plus
    • UniApp
  • 框架

    • Vue3
  • 拓展包

    • 包管理工具
    • 包开发
  • 开发语言

    • C语言
    • PHP
    • Phyton
  • 框架

    • Laravel
  • 会计

    • 初级经济法基础
    • 初级会计实务
  • 软考

    • 信息系统项目管理师
  • 博客

    • vitepress
    • vuepress
  • manim
  • git
  • vsCode
  • latex
  • docker
  • axios
  • vim
  • mac
  • Jetbrains

    • phpstorm
    • clion
突发奇想
GitHub (opens new window)
  • introduction
    • install
    • Configuration
    • theme
      • Nav
      • Sidebar
      • Prev Next Link
      • Edit Link
      • Last Updated
      • Layout
      • Home Page
      • Team Page
      • Footer
      • Search
      • Carbon Ads
    • 自动部署
      • Github
    • 网页标题栏 ico
    • 外链
    • 底部信息
    • 评论
  • DevelopmentTheme
  • UseTheme
  • 《vitepress》
诚城
2022-08-19
目录

introduction原创

# install

Create and change into a new directory.

mkdir vitepress-starter && cd vitepress-starter

Then, initialize with your preferred package manager.

yarn init
yarn add --dev vitepress vue
mkdir docs && echo '# Hello VitePress' > docs/index.md

Add some scripts to package.json.

{
  ...
  "scripts": {
    "docs:dev": "vitepress dev docs",
    "docs:build": "vitepress build docs",
    "docs:serve": "vitepress serve docs"
  },
  ...
}

# Configuration

Without any configuration, the page is pretty minimal, and the user has no way to navigate around the site. To customize your site, let's first create a .vitepress directory inside your docs directory. This is where all VitePress-specific files will be placed. Your project structure is probably like this:

# theme

# Nav

# Sidebar

# Prev Next Link

# Edit Link

# Last Updated

# Layout

# Home Page

# Team Page

# Footer

# Search

# Carbon Ads

# 自动部署

# Github

Create a file named deploy.yml inside .github/workflows directory of your project with the following content:

name: Deploy

on:
  push:
    branches:
      - main

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v3
        with:
          node-version: 16
          cache: yarn
      - run: yarn install --frozen-lockfile

      - name: Build
        run: yarn docs:build

      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: docs/.vitepress/dist

# 网页标题栏 ico

favicon.ico 文件放置到 /docs/public 即可 。

# 外链

themeConfig: {
    logo: '/@32px.svg', // 文件文字 /docs/public
    socialLinks: [ // 设置图标外链
      { icon: 'github', link: 'https://github.com/vuejs/vitepress' },
      { icon: 'twitter', link: '...' },
      // You can also add custom icons by passing SVG as string:
      {
        icon: {
          svg: '<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Dribbble</title><path d="M12...6.38z"/></svg>'
        },
        link: '...'
      }
    ]
  }

# 底部信息

themeConfig: {
  footer: {
    message: 'MIT License.',
    copyright: 'Copyright © 2022-present Carveybunt'
  }
}

# 评论

目前评论的使用方式并不是很优,尝试了几种方式,基于现状也找不到更格式的方式了,这个也可能和vitepress的宗旨(并不是vuepress的下一代)或者还没到正式版优关系

使用方式是在想开评论的文章最后加一个 <Comment />

.vitepress/config.js 这个文件中的 comment 部分换成自己的仓库,才能正确的保存评论

...
comment: {
    repo: 'airene/vitepress-blog-pure', //你自己的用户名和仓库名
    themes: 'github-light',
    issueTerm: 'pathname'
}
...
上次更新: 2022/08/23, 18:12:45
DevelopmentTheme

DevelopmentTheme→

Theme by Vdoing | Copyright © 2022-2022 carveybunt | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式
×
×

特别申明:

本站所有内容均为个人理解或转载,如有不当之处,敬请大佬指导!