GithubHelp home page GithubHelp logo

pengzhanbo / vuepress-theme-plume Goto Github PK

View Code? Open in Web Editor NEW
24.0 1.0 3.0 35.15 MB

Vuepress Theme. A simple, feature-rich, document & blog

Home Page: https://plume.pengzhanbo.cn

License: MIT License

JavaScript 0.36% TypeScript 44.05% Vue 40.53% HTML 0.11% SCSS 14.24% CSS 0.70%
theme vuepress typescript vue blog document vuepress-theme

vuepress-theme-plume's Introduction

vuepress-theme-plume's People

Contributors

huankong233 avatar northword avatar pengzhanbo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

vuepress-theme-plume's Issues

[new feature] RC 阶段 更新列表

破坏性更新

  • ‼️ 主题包名 @vuepress-plume/vuepress-theme-plume 重命名为 vuepress-theme-plume.
    旧的包将被标记为 Deprecate
  • ‼️ 所有插件名 @vuepress-plume/vuepress-plugin-* 重命名为 @vuepress-plume/plugin-*
    旧的包将被标记为 Deprecate
  • ‼️ 移除代码高亮插件 @vuepress/shiki(build) 和 @vuepress/prismjs(dev) ,使用 @vuepress-plume/plugin-shikiji 实现代码高亮,支持更丰富的功能
  • monorepo 目录结构调整,移除 packages,插件迁移至 plugins/*,主题迁移至 theme

主要更新

  • 新增插件 @vuepress-plume/plugin-shikiji: 使用 shikiji 实现代码高亮
  • 优化 plugin-copy-code 插件,优化 UI,交互体验
  • 为代码提供 行高亮: 新增行、删除行、警告行、错误行、聚焦行 等。
  • 代码块高亮 支持 亮色/暗色 主题切换
  • 优化内容容器样式
  • 优化主题 CSS 变量
  • 新增 文章更新时间、编辑交互、contributors、 页面 prev/next
  • 新增 文章阅读时间
  • 添加 友情链接 页面支持
  • 添加 博客文章 标签页面、归档页面
  • 新增页面打印支持
  • 增强对 多语言配置的支持
  • 博客文章列表页 分页支持
  • 新增本地搜索功能,使用 minisearch 替换官方本地搜索插件
  • 新增 全站加密、部分加密 功能
  • 全新的首页

优化更新

  • 优化移动端 TOC 交互
  • 新增部分页面文本内容配置选项
  • 优化编写md时运行时注入的插件实现预期的热更新
  • 新增 back-to-top 按钮
  • 优化主题默认配置预设,进一步减少用户不必要的配置项
  • 新增侧边栏图标支持

试验性功能

其它

  • 文档更新

Tip

欢迎提出您期望的功能,欢迎通过 PR 的方式帮助完善本项目!

ERR_INVALID_ARG_TYPE

error error in hook onWatched from @vuepress-plume/plugin-notes-data
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
按照文档的快速上手启动就报错

使用 `Typora` 编写文档 并使用 `PicGo` 上传图片导致报错

问题如题,报错代码:

========================= ↓ 图片复制到了文档内
info page note\algorithm\2.数据结构\链表.md is modified
15:00:01 [vite] hmr update /@fs/C:/Users/huan_kong/Desktop/code/blog/src/.vuepress/.temp/internal/notesData.js
15:00:01 [vite] hmr update /@fs/C:/Users/huan_kong/Desktop/code/blog/src/.vuepress/.temp/internal/blogData.js
15:00:01 [vite] hmr update /@fs/C:/Users/huan_kong/Desktop/code/blog/src/.vuepress/.temp/pages/note/algorithm/数据结构/链
表/index.html.vue
15:00:01 [vite] hmr update /@fs/C:/Users/huan_kong/Desktop/code/blog/src/.vuepress/.temp/pages/note/algorithm/数据结构/链
表/index.html.js
15:00:02 [vite] Internal server error: Failed to resolve import "@source/note/algorithm/2.数据结构/C:/Users/huan_kong/AppData/Roaming/Typora/typora-user-images/image-20231127150000447.png" from "src\.vuepress\.temp\pages\note\algorithm\数据结
构\链表\index.html.vue". Does the file exist?
  Plugin: vite:import-analysis
  File: C:/Users/huan_kong/Desktop/code/blog/src/.vuepress/.temp/pages/note/algorithm/数据结构/链表/index.html.vue:3:25  
  1  |  const _sfc_main = {}
  2  |  import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue"
  3  |  import _imports_0 from '@source/note/algorithm/2.数据结构/C:/Users/huan_kong/AppData/Roaming/Typora/typora-user-images/image-20231127150000447.png'
     |                          ^
  4  |
  5  |
      at formatError (file:///C:/Users/huan_kong/Desktop/code/blog/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-T98iZFpD.js:61701:46)
      at TransformContext.error (file:///C:/Users/huan_kong/Desktop/code/blog/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-T98iZFpD.js:61695:19)
      at normalizeUrl (file:///C:/Users/huan_kong/Desktop/code/blog/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-T98iZFpD.js:59988:33)
      at async file:///C:/Users/huan_kong/Desktop/code/blog/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-T98iZFpD.js:60138:47
      at async Promise.all (index 1)
      at async TransformContext.transform (file:///C:/Users/huan_kong/Desktop/code/blog/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-T98iZFpD.js:60059:13)
      at async Object.transform (file:///C:/Users/huan_kong/Desktop/code/blog/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-T98iZFpD.js:61996:30)
      at async loadAndTransform (file:///C:/Users/huan_kong/Desktop/code/blog/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-T98iZFpD.js:47780:29)
      at async viteTransformMiddleware (file:///C:/Users/huan_kong/Desktop/code/blog/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-T98iZFpD.js:57379:32)
========================= ↓ 上传完成
info page note\algorithm\2.数据结构\链表.md is modified
15:00:03 [vite] hmr update /@fs/C:/Users/huan_kong/Desktop/code/blog/src/.vuepress/.temp/internal/notesData.js
15:00:03 [vite] hmr update /@fs/C:/Users/huan_kong/Desktop/code/blog/src/.vuepress/.temp/internal/blogData.js
15:00:03 [vite] page reload C:/Users/huan_kong/Desktop/code/blog/src/.vuepress/.temp/pages/note/algorithm/数据结构/链表/index.html.vue
15:00:03 [vite] hmr update /@fs/C:/Users/huan_kong/Desktop/code/blog/src/.vuepress/.temp/pages/note/algorithm/数据结构/链
表/index.html.js

虽然不会导致崩溃,但是有点像狗皮膏药,看着难受

TypeError: Cannot read properties of undefined (reading 'notes')

TypeError: Cannot read properties of undefined (reading 'notes')
at file:///E:/Github/docs/node_modules/@vuepress-plume/vuepress-theme-plume/lib/node/autoFrontmatter.js:26:53
at Array.map ()
at autoFrontmatter (file:///E:/Github/docs/node_modules/@vuepress-plume/vuepress-theme-plume/lib/node/autoFrontmatter.js:25:10)
at setupPlugins (file:///E:/Github/docs/node_modules/@vuepress-plume/vuepress-theme-plume/lib/node/plugins.js:46:31)
at file:///E:/Github/docs/node_modules/@vuepress-plume/vuepress-theme-plume/lib/node/theme.js:25:22
at resolvePluginObject (file:///E:/Github/docs/node_modules/@vuepress/core/dist/index.js:635:65)
at resolveThemeInfo (file:///E:/Github/docs/node_modules/@vuepress/core/dist/index.js:927:23)
at setupAppThemeAndPlugins (file:///E:/Github/docs/node_modules/@vuepress/core/dist/index.js:946:21)
at createBaseApp (file:///E:/Github/docs/node_modules/@vuepress/core/dist/index.js:975:3)
at createBuildApp (file:///E:/Github/docs/node_modules/@vuepress/core/dist/index.js:981:15)

[new feature]: 重新设计 首页 UI

当前主题的 首页 UI 相对简单,比较枯燥。计划对其进行 重新设计。

预期目标

  • 支持 博客 & 文档
  • 将不同的内容 按 卡片 的形式划分,支持 一定程度上的自由组合。

已实现功能

  • Hero 板块
  • Features 板块
  • Text Image 板块
  • Image Text 板块
  • Profile 板块
  • Banner 板块
  • Custom 板块
  • 支持自定义组件,注入到全局后,在 Home 中使用

note 页面有误

复现环境: Windows 10
复现过程:

使用的博主的仓库

image

左侧 边栏丢失

image

我检查了一下代码,发现是这个变量返回了 false

image

如何使用 Algolia DocSearch 索引本主题

请教一下如何使用 Algolia DocSearch 索引本主题

以下为我的配置文件,records 一直都是空的 🤔

new Crawler({
  rateLimit: 8,
  maxDepth: 10,
  startUrls: ["https://blog.huankong.top/"],
  renderJavaScript: false,
  sitemaps: ["https://blog.huankong.top/sitemap.xml"],
  ignoreCanonicalTo: false,
  discoveryPatterns: ["https://blog.huankong.top/**"],
  schedule: "at 02:00 every 1 day",
  actions: [
    {
      indexName: "huankong",
      pathsToMatch: ["https://blog.huankong.top/**"],
      recordExtractor: ({ $, helpers }) => {
        return helpers.docsearch({
          recordProps: {
            lvl0: {
              selectors: ".sidebar-item.is-active",
              defaultValue: "Documentation",
            },
            lvl1: ".content-container h1",
            lvl2: ".content-container h2",
            lvl3: ".content-container h3",
            lvl4: ".content-container h4",
            lvl5: ".content-container h5",
            lvl6: ".content-container h5",
            content: ".content-container p, .content-container li",
          },
          indexHeadings: true,
        });
      },
    },
  ],
  initialIndexSettings: {
    huankong: {
      attributesForFaceting: ["type", "lang", "language", "version"],
      attributesToRetrieve: [
        "hierarchy",
        "content",
        "anchor",
        "url",
        "url_without_anchor",
        "type",
      ],
      attributesToHighlight: ["hierarchy", "hierarchy_camel", "content"],
      attributesToSnippet: ["content:10"],
      camelCaseAttributes: ["hierarchy", "hierarchy_radio", "content"],
      searchableAttributes: [
        "unordered(hierarchy_radio_camel.lvl0)",
        "unordered(hierarchy_radio.lvl0)",
        "unordered(hierarchy_radio_camel.lvl1)",
        "unordered(hierarchy_radio.lvl1)",
        "unordered(hierarchy_radio_camel.lvl2)",
        "unordered(hierarchy_radio.lvl2)",
        "unordered(hierarchy_radio_camel.lvl3)",
        "unordered(hierarchy_radio.lvl3)",
        "unordered(hierarchy_radio_camel.lvl4)",
        "unordered(hierarchy_radio.lvl4)",
        "unordered(hierarchy_radio_camel.lvl5)",
        "unordered(hierarchy_radio.lvl5)",
        "unordered(hierarchy_radio_camel.lvl6)",
        "unordered(hierarchy_radio.lvl6)",
        "unordered(hierarchy_camel.lvl0)",
        "unordered(hierarchy.lvl0)",
        "unordered(hierarchy_camel.lvl1)",
        "unordered(hierarchy.lvl1)",
        "unordered(hierarchy_camel.lvl2)",
        "unordered(hierarchy.lvl2)",
        "unordered(hierarchy_camel.lvl3)",
        "unordered(hierarchy.lvl3)",
        "unordered(hierarchy_camel.lvl4)",
        "unordered(hierarchy.lvl4)",
        "unordered(hierarchy_camel.lvl5)",
        "unordered(hierarchy.lvl5)",
        "unordered(hierarchy_camel.lvl6)",
        "unordered(hierarchy.lvl6)",
        "content",
      ],
      distinct: true,
      attributeForDistinct: "url",
      customRanking: [
        "desc(weight.pageRank)",
        "desc(weight.level)",
        "asc(weight.position)",
      ],
      ranking: [
        "words",
        "filters",
        "typo",
        "attribute",
        "proximity",
        "exact",
        "custom",
      ],
      highlightPreTag: '<span class="algolia-docsearch-suggestion--highlight">',
      highlightPostTag: "</span>",
      minWordSizefor1Typo: 3,
      minWordSizefor2Typos: 7,
      allowTyposOnNumericTokens: false,
      minProximity: 1,
      ignorePlurals: true,
      advancedSyntax: true,
      attributeCriteriaComputedByMinProximity: true,
      removeWordsIfNoResults: "allOptional",
    },
  },
  appId: "U198Y5GBFG",
  apiKey: "xxxxx",
});

navbar 文字问题

image

这个文字会竖起来,很影响美观,我想到的办法是加大 768px -> 840px
但是这样不完全能保证不出问题,可以的话考虑解决一下,还有博主部署的页面navbar部分怎么重复了

运行报错

yarn run v1.22.19
$ vuepress dev src
/ notes
locales notes dirs [ '/' ] [ '\\notes' ]
⠙ Initializing and preparing dataerror error in hook onPrepared from @vuepress-plume/vuepress-plugin-notes-data
✖ Initializing and preparing data - failed in 92ms
SyntaxError: Invalid regular expression: /^notes\/: \ at end of pattern
    at new RegExp (<anonymous>)
    at prepareNotesData (file:///C:/Users/huan_kong/Desktop/code/blog/node_modules/@vuepress-plume/vuepress-plugin-notes-data/lib/node/prepareNotesData.js:25:25)
    at Object.onPrepared [as hook] (file:///C:/Users/huan_kong/Desktop/code/blog/node_modules/@vuepress-plume/vuepress-plugin-notes-data/lib/node/plugin.js:8:31)
    at Object.process (file:///C:/Users/huan_kong/Desktop/code/blog/node_modules/@vuepress/core/dist/index.js:681:37)
    at async appPrepare (file:///C:/Users/huan_kong/Desktop/code/blog/node_modules/@vuepress/core/dist/index.js:624:3)
    at async file:///C:/Users/huan_kong/Desktop/code/blog/node_modules/@vuepress/cli/dist/index.js:488:7
    at async file:///C:/Users/huan_kong/Desktop/code/blog/node_modules/@vuepress/utils/dist/index.js:106:20
    at async CAC.dev (file:///C:/Users/huan_kong/Desktop/code/blog/node_modules/@vuepress/cli/dist/index.js:486:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

在使用 Typora 编写文档时,程序会崩溃

可以加一个选项来选择excude选项吗

return {
include: ['**/*.md'],
frontmatter: [
localesNotesDirs.length
? {
// note 首页链接
include: localesNotesDirs.map((dir) =>
normalizePath(path.join(dir, '**/{readme,README,index}.md'))
),
frontmatter: {
title(title: string, { filepath }) {
if (title) return title
const note = findNote(filepath)
if (note?.text) return note.text
return getCurrentDirname(note, filepath) || ''
},
...baseFrontmatter,
permalink(permalink: string, { filepath }) {
if (permalink) return permalink
const locale = resolveLocale(filepath)
const notes = notesByLocale(locale)
const note = findNote(filepath)
return normalizePath(
path.join(
locale,
notes?.link || '',
note?.link || getCurrentDirname(note, filepath),
'/'
)
)
},
},
}
: '',
localesNotesDirs.length
? {
include: localesNotesDirs.map((dir) =>
normalizePath(path.join(dir, '**/**.md'))
),
frontmatter: {
title(title: string, { filepath }) {
if (title) return title
const basename = path.basename(filepath, '.md')
return basename
},
...baseFrontmatter,
permalink(permalink: string, { filepath }) {
if (permalink) return permalink
const locale = resolveLocale(filepath)
const note = findNote(filepath)
const notes = notesByLocale(locale)
return normalizePath(
path.join(
locale,
notes?.link || '',
note?.link || getCurrentDirname(note, filepath),
nanoid(),
'/'
)
)
},
},
}
: '',
{
include: '**/{readme,README,index}.md',
frontmatter: {},
},
{
include: '*',
frontmatter: {
title(title: string, { filepath }) {
if (title) return title
const basename = path.basename(filepath, '.md')
return basename
},
...baseFrontmatter,
permalink(permalink: string, { filepath }) {
if (permalink) return permalink
const locale = resolveLocale(filepath)
return normalizePath(
path.join(locale, articlePrefix, nanoid(), '/')
)
},
},
},
].filter(Boolean) as FrontmatterArray,
}

在我使用 Typora 编写文档时,程序会崩溃

我翻了一下源码,我看到可以配置不监控哪些文件

exclude = ['.vuepress/**/*', 'node_modules'],

报错日志

❯ pd

> [email protected] dev C:\Users\huan_kong\Desktop\code\blog
> vuepress dev src --clean-cache --clean-temp

✔ Cleaning temp - done in 30ms
✔ Cleaning cache - done in 5ms
✔ Initializing and preparing data - done in 4.50s

  vite v4.4.11 dev server running at:

  ➜  Local:   http://localhost:8081/
  ➜  Network: http://192.168.31.104:8081/
  ➜  Network: http://172.22.132.245:8081/
info page note\algorithm\2.数据结构\数组.md is created
info page note\algorithm\2.数据结构\数组.md is modified
info page note\algorithm\2.数据结构\1.数组.md is removed
10:40:20 [vite] page reload C:/Users/huan_kong/Desktop/code/blog/src/.vuepress/.temp/internal/pagesComponents.
10:40:20 [vite] page reload C:/Users/huan_kong/Desktop/code/blog/src/.vuepress/.temp/internal/pagesData.js
10:40:20 [vite] page reload C:/Users/huan_kong/Desktop/code/blog/src/.vuepress/.temp/internal/pagesRoutes.js
10:40:20 [vite] hmr update /@fs/C:/Users/huan_kong/Desktop/code/blog/src/.vuepress/.temp/internal/notesData.js
10:40:20 [vite] hmr update /@fs/C:/Users/huan_kong/Desktop/code/blog/src/.vuepress/.temp/internal/blogData.js
10:40:20 [vite] page reload C:/Users/huan_kong/Desktop/code/blog/src/.vuepress/.temp/internal/pagesComponents.
10:40:20 [vite] page reload C:/Users/huan_kong/Desktop/code/blog/src/.vuepress/.temp/internal/pagesData.js
10:40:20 [vite] page reload C:/Users/huan_kong/Desktop/code/blog/src/.vuepress/.temp/internal/pagesRoutes.js
node:fs:1690
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, stat 'C:\Users\huan_kong\Desktop\code\blog\src\note\algorithm\2.数据md'
    at Object.statSync (node:fs:1690:3)
    at readMarkdown (file:///C:/Users/huan_kong/Desktop/code/blog/node_modules/.pnpm/@[email protected]/node_modules/@vuepress-plume/vuepress-plugin-auto-frontmatter/lib/node/readFiles.js:
    at FSWatcher.<anonymous> (file:///C:/Users/huan_kong/Desktop/code/blog/node_modules/.pnpm/@[email protected]/node_modules/@vuepress-plume/vuepress-plugin-auto-frontmatter/lib/node/plug    at FSWatcher.emit (node:events:514:28)
    at FSWatcher.emitWithAll (C:\Users\huan_kong\Desktop\code\blog\node_modules\.pnpm\[email protected]\node_modu\index.js:540:8)
    at FSWatcher._emit (C:\Users\huan_kong\Desktop\code\blog\node_modules\.pnpm\[email protected]\node_modules\ch.js:632:8)
    at NodeFsHandler._handleFile (C:\Users\huan_kong\Desktop\code\blog\node_modules\.pnpm\[email protected]\node_idar\lib\nodefs-handler.js:400:14)
    at NodeFsHandler._addToNodeFs (C:\Users\huan_kong\Desktop\code\blog\node_modules\.pnpm\[email protected]\nodekidar\lib\nodefs-handler.js:637:21) {
  errno: -4058,
  syscall: 'stat',
  code: 'ENOENT',
  path: 'C:\\Users\\huan_kong\\Desktop\\code\\blog\\src\\note\\algorithm\\2.数据结构\\.~数组.md'
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.