参考网址

主页 | 百家饭OpenAPI平台 (rongapi.cn)在新窗口打开

官网

https://v2.vuepress.vuejs.org/zh/ 官网

https://v2.vuepress.vuejs.org/zh/guide/getting-started.html

参考学习

2.0介绍

(22条消息) Vuepress2.X从0-1保姆级入门教程_passwordgloo的博客-CSDN博客_vuepress 教程在新窗口打开

1.0介绍

(22条消息) VuePress 博客搭建系列 33 篇正式完结_冴羽的JavaScript博客的博客-CSDN博客在新窗口打开

安装

  1. 卡在idealTree:npm: sill idealTree buildDeps

    npm config get registry,查看当前镜像地址

    npm config set registry https://registry.npm.taobao.org ,更换镜像地址

依赖安装

npm install -g yarn & yarn add gulp-less

npm install -g pnpm

npm install -g npm@9.1.1

运行

1.Error: Cannot find module 'vue-template-compiler'

npm install vue-template-compiler

2.启动命令

yarn docs:dev

主题

https://www.npmjs.com/package/vuepress-theme-knzn

默认主体路径

vuepress-starter\node_modules@vuepress\theme-default

插件

DocSearch

VuePress 2.0 中使用 Algolia DocSearch 文档搜索功能的配置 | ImCaO's Blog在新窗口打开

DOCSearch官网在新窗口打开 注册api

我安装的插件

@vssue/api-github-v3@1.4.7 ├── @vuepress/plugin-nprogress@2.0.0-beta.53 ├── busuanzi.pure.js@1.0.3 ├── gulp-less@5.0.0 ├── vssue@1.4.8 └── vuepress@2.0.0-beta.53

视频资源

https://www.bilibili.com/video/BV18L41177Bm/?p=9&spm_id_from=pageDriver&vd_source=c52fb0c993ee2ee6c1a95de628d86f2f

简单介绍

https://www.bilibili.com/video/BV1G64y1Z75s/?spm_id_from=autoNext&vd_source=c52fb0c993ee2ee6c1a95de628d86f2f

君哥的学习笔记 (it235.com)在新窗口打开

md文件

首页菜单用H1 saidbar 用h2

统计

不蒜子插件配置

03-配置vuepress插件 | WeiG's blog (wggz.top)在新窗口打开

data | 秋蝉前端 (leader755.com)在新窗口打开

51.la后台统计(Puma)

访问概况 - 51.LA网站统计V6在新窗口打开

百度统计

(22条消息) vuepress+百度统计 API 调用+源码_贝茵斯都的博客-CSDN博客_vuepress 访问量在新窗口打开

Vuepress添加评论插件valine原创 - 腾讯云开发者社区-腾讯云 (tencent.com)在新窗口打开

评论系统

valine.js

文章阅读量统计 | Valine 一款快速、简洁且高效的无后端评论系统。在新窗口打开

https://valine.js.org/

1.注册LeanCloud在新窗口打开

giscus

1.在github 开启

Settings>Features>Discussions

2.安装 GitHub Apps - giscus在新窗口打开

安装完成后,codespaces>selectd repositories

3.注册giscus在新窗口打开

4.修改配置

在 head.ts 里添加

<script src="https://giscus.app/client.js"
        data-repo="baoshan2020/baoshan2020.github.io"
        data-repo-id="MDEwOlJlcG9zaXRvcnkyNDg2ODM4NjM="
        data-category="Announcements"
        data-category-id="DIC_kwDODtKdV84CSxPl"
        data-mapping="pathname"
        data-strict="0"
        data-reactions-enabled="1"
        data-emit-metadata="0"
        data-input-position="bottom"
        data-theme="light"
        data-lang="zh-CN"
        crossorigin="anonymous"
        async>
</script>

在configts

plugins: [ ]里添加

 commentPlugin({

  // 插件选项

  provider: "Giscus", //评论服务提供者。

  comment: true, //启用评论功能

  repo: "baoshan2020/baoshan2020.github.io", //远程仓库

  repoId: "MDEwOlJlcG9zaXRvcnkyNDg2ODM4NjM=", //对应自己的仓库Id

  category: "Announcements",

  categoryId: "DIC_kwDODtKdV84CSxPl" //对应自己的分类Id

 }),

在md文件结尾添加

<CommentService />

或者 在page.vue 添加

<script setup lang="ts">
import PageMeta from '@theme/PageMeta.vue'
import PageNav from '@theme/PageNav.vue'
</script>


<template>
  <main class="page">
    <slot name="top" />


    <div class="theme-default-content">
      <slot name="content-top" />


      <Content />


      <slot name="content-bottom" />
    </div>


    <PageMeta />


    <PageNav />

    <slot name="bottom" />
    <CommentService />
  </main>
</template>

教你使用Giscus在Vuepress2中开启评论功能-pudn.com在新窗口打开

参考文章

Vssue在新窗口打开 VuePress 博客优化之增加 Vssue 评论功能 · Issue #270 · mqyqingfeng/Blog (github.com)在新窗口打开

Client ID:18e37635c7b7f2a4bfaa

Client secrets:5c26178bbdf3d176e457d946fa8ac7d6a8a8013a

https://gitalk.github.io 准备安装

给你的 VuePress 添加 Gitalk 评论插件吧 - 掘金 (juejin.cn)在新窗口打开

时间轴

yarn和npm的区别

(22条消息) yarn和npm的区别_程序员june的博客-CSDN博客_npm和yarn在新窗口打开

github

一篇教你代码同步 Github 和 Gitee · Issue #236 · mqyqingfeng/Blog在新窗口打开

错误1

Warning: Permanently added 'github.com' (ED25519) to the list of known hosts. git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.

添加用户名和密码

https://blog.csdn.net/helloasimo/article/details/123778112

第1步:git config --global --list

第2步: ssh-keygen -t rsa -C 398068229@qq.com

第3步: 使用浏览器到git仓库:右上角--> settings --> SSH and GPG keys ....

第4步:ssh -T git@github.com

错误2

compiling with vite[vite:vue] Cannot set properties of undefined (setting 'id')

⠼ Compiling with vite[vite:vue] Cannot set properties of undefined (setting 'id')

file: D:/hugo/vuepress-starter/docs/.vuepress/.temp/pages/about.html.vue✖ Compiling with vite - failed in 549msTypeError: Cannot set properties of undefined (setting 'id')at createDescriptor (file:///D:/hugo/vuepress-starter/node_modules/@vuepress/bundler-vite/node_modules/@vitejs/plugin-vue/dist/index.mjs:66:17)at transformMain (file:///D:/hugo/vuepress-starter/node_modules/@vuepress/bundler-vite/node_modules/@vitejs/plugin-vue/dist/index.mjs:2212:34)at Object.transform (file:///D:/hugo/vuepress-starter/node_modules/@vuepress/bundler-vite/node_modules/@vitejs/plugin-vue/dist/index.mjs:2701:16)at Object.handler (file:///D:/hugo/vuepress-starter/node_modules/vite/dist/node/chunks/dep-4da11a5e.js:46032:19) at file:///D:/hugo/vuepress-starter/node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:22710:40

安装依赖未解决

感觉是评论系统出现了问题

(22条消息) 在VuePress中添加Gitalk评论_元无心的博客-CSDN博客_vuepress gitalk在新窗口打开

yarn add -D vuepress@next

导入了插件import { searchPlugin } from '@vuepress/plugin-search'

错误3:outside of Vite serving allow list.

A:tip dev server has restarted, please refresh your browser The request url "D:/hugo/vuepress-starter/node_modules/@vuepress/theme-default/node_modules/@vuepress/plugin-back-to-top/lib/client/styles/back-to-top.svg" is outside of Vite serving allow list.

Q:Refer to docs https://vitejs.dev/config/server-options.html#server-fs-allow for configurations and more details.

export default defineConfig({ server: { origin: 'http://127.0.0.1:8080' } })

在gitee或github上进行同步

码云上就能直接从github或gitlab在新窗口打开中导入

生成静态网页错误

Compiling with vite[vite:vue] Element is missing end tag.

需要查看保存的文件。把影响html 改成代码模式

Loading...

腾讯开发者社区

腾讯云开发者社区-腾讯云 (tencent.com)在新窗口打开

插件https://cloud.tencent.com/developer/article/2003657

Loading...