君玉自牧 君玉自牧
首页
  • Linux
  • Nginx
  • MySQL
  • Redis
  • Kafka
  • Docker
  • Jenkins
  • Oneindex
  • Bitwarden
  • Confluence
  • Photogallery
  • 智能手机
  • 上古卷轴
  • 健身记录
  • 站点相关
  • 未完待续
GitHub (opens new window)
首页
  • Linux
  • Nginx
  • MySQL
  • Redis
  • Kafka
  • Docker
  • Jenkins
  • Oneindex
  • Bitwarden
  • Confluence
  • Photogallery
  • 智能手机
  • 上古卷轴
  • 健身记录
  • 站点相关
  • 未完待续
GitHub (opens new window)
  • 技术架构

  • 桌面维护

  • 网络工程

  • 系统运维

  • 环境搭建

  • 容器编排

  • 持续集成

  • 监控告警

  • 项目实践

  • 脚本开发

  • 前端开发

    • Windows 系统搭建 Node.js 环境
    • Vue 开发入门
    • 搭建 VuePress:Github & Aliyun
      • 指定目录
      • 安装依赖
      • 启动项目
      • 安装主题
        • 更新主题
        • 使用插件
      • 更多设置
    • 本地开发:泛(内网)域名解析
    • SSL 证书申请以及自动续期
    • 自动跳转 https 访问网站
    • asar 文件解包、修改再打包
  • 后端开发

  • 效率工具

目录

搭建 VuePress:Github & Aliyun

说明

  • VuePress 2.0 构建报错,懒得折腾,继续使用 1.0
  • 使用 Github Actions 部署到 Github Pages 和阿里云虚拟主机FTP(传输有点慢)

# 指定目录

mkdir Library
cd Library
1
2

# 安装依赖

警告

不要全局安装,选择依赖安装

    yarn init
    yarn add -D vuepress
    
    1
    2
    npm init
    npm install -D vuepress
    
    1
    2
    // Make sure to add code blocks to your code group

    在 package.json 中,新增启动命令:

    "scripts": {
    "docs:dev": "set NODE_OPTIONS=--openssl-legacy-provider && vuepress dev docs",
    "docs:build": "set NODE_OPTIONS=--openssl-legacy-provider && vuepress build docs"
    }
    
    1
    2
    3
    4

    注意

    构建报错:Error: error:0308010C:digital envelope routines::unsupported

    搜索说是 Node.js 版本问题,得每次运行 set NODE_OPTIONS=--openssl-legacy-provider

    索性直接加到 package.json 中

    # 启动项目

      yarn docs:dev
      
      1
      npm  docs:dev
      
      1
      // Make sure to add code blocks to your code group

      新增 .gitignore 文件(git 上传忽略),按需添加想要的内容,如:

      #Idea
      .idea
      
      #VuePress
      docs\.vuepress\dist
      temp
      cache
      
      #NPM
      node_modules
      yarn.lock
      
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11

      # 安装主题

      懒得折腾直接使用主题

        yarn add -D vuepress-theme-vdoing
        
        1
        npm install -D vuepress-theme-vdoing
        
        1
        // Make sure to add code blocks to your code group

        然后在 config.js 中引用

        theme: 'vdoing'
        
        1

        # 更新主题

        yarn remove vuepress-theme-vdoing
        #删除 node_modules 文件夹
        yarn add -D vuepress-theme-vdoing
        yarn
        
        1
        2
        3
        4

        # 使用插件

          #网络不行可以加上 --registry=https://registry.npmmirror.com
          yarn add -D @vuepress/plugin-back-to-top
          yarn add -D @vuepress/plugin-medium-zoom
          yarn add -D @vuepress/plugin-last-updated
          yarn add -D @vuepress/plugin-pwa
          yarn add -D vuepress-plugin-fulltext-search
          yarn add -D vuepress-plugin-reading-progress
          yarn add -D vuepress-plugin-smplayer@1
          
          1
          2
          3
          4
          5
          6
          7
          8
          #网络不行可以加上 --registry=https://registry.npmmirror.com
          npm install -D @vuepress/plugin-back-to-top
          npm install -D @vuepress/plugin-medium-zoom
          npm install -D @vuepress/plugin-last-updated
          npm install -D @vuepress/plugin-pwa
          npm install -D vuepress-plugin-fulltext-search
          npm install -D vuepress-plugin-reading-progress
          npm install -D vuepress-plugin-smplayer@1
          
          1
          2
          3
          4
          5
          6
          7
          8
          // Make sure to add code blocks to your code group

          然后在 config.js 中引用

          plugins: []
          
          1

          # 更多设置

          来自网络

          • v1.0 文档 (opens new window)
          • 主题配置 (opens new window)
          • Markdown 容器 (opens new window)
          • 动态首页大图 & 全背景图 (opens new window)
          网页编辑 (opens new window)
          最近提交: 2023/03/22, 11:52:35
          Vue 开发入门
          本地开发:泛(内网)域名解析

          ← Vue 开发入门 本地开发:泛(内网)域名解析→

          Theme by Vdoing | Copyright © 2011-2023 | 君玉自牧
          粤ICP备15057965号
          • 跟随系统
          • 浅色模式
          • 深色模式
          • 阅读模式