volantis-x / hexo-theme-volantis

A Wonderful Theme for Hexo.
https://volantis.js.org
MIT License
1.98k stars 596 forks source link

【问题】:自定义右键菜单右键复制问题 #900

Open bolnk opened 11 months ago

bolnk commented 11 months ago

检查清单

主题版本

5.x

复现地址

暂无

问题描述

自定义右键菜单会生效,只是复制选择文本会在右上角提示“错误提示”,并且没在浏览器控制台发现报错信息

配置文件

_config.volantis.yml配置文件中的内容

rightmenus:
  enable: true
  order:
    - plugins.navigation
    - hr
    - plugins.inputBox
    - plugins.seletctText
    - plugins.elementCheck
    - plugins.elementImage
    - menus.link
    - hr
    - menus.darkMode
    - plugins.articlePage

  options:
    iconPrefix: fa-solid
    articleShowLink: true
    musicAlwaysShow: false
  plugins:
    navigation:
      - {id: 'left', name: '转到上一页', icon: 'fa-solid fa-arrow-left', event: 'history.back()', group: 'navigation'}
      - {id: 'right', name: '转到下一页', icon: 'fa-solid fa-arrow-right', event: 'history.forward()', group: 'navigation'}
      - {id: 'redo', name: '刷新当前页面', icon: 'fa-solid fa-redo', event: 'window.location.reload()', group: 'navigation'}
      - {id: 'up', name: '回到顶部', icon: 'fa-solid fa-arrow-up', event: 'VolantisApp.scrolltoElement(volantis.dom.bodyAnchor)', group: 'navigation'}
    inputBox:
      - {id: 'copyPaste', name: '粘贴文本', icon: 'fa-solid fa-paste', event: 'copyPaste', group: 'inputBox'}
      - {id: 'copyAll', name: '全选文本', icon: 'fa-solid fa-object-ungroup', event: 'copyAll', group: 'inputBox'}
      - {id: 'copyCut', name: '剪切文本', icon: 'fa-solid fa-cut', event: 'copyCut', group: 'inputBox'}
    seletctText:
      - {id: 'copyText', name: '复制文本', icon: 'fa-solid fa-copy', event: 'copyText', group: 'seletctText'}
      - {id: 'searchWord', name: '站内搜索', icon: 'fa-solid fa-search', event: 'OpenSearch(__text__)', group: 'seletctText'}
      - {id: 'bingSearch', name: '必应搜索', icon: 'fa-solid fa-search', event: 'window.open(`https://cn.bing.com/search?q=${__text__}`)', group: 'seletctText'}
    elementCheck:
      - {id: 'openTab', name: '新标签页打开', icon: 'fa-solid fa-external-link-square-alt', event: 'window.open(__link__)', group: 'elementCheck'}
      - {id: 'copyLink', name: '复制链接地址', icon: 'fa-solid fa-link', event: 'copyLink', group: 'elementCheck'}
    elementImage:
      - {id: 'copyImg', name: '复制图片', icon: 'fa-solid fa-image', event: 'copyImg', group: 'elementImage'}
      - {id: 'googleImg', name: '谷歌识图', icon: 'fa-solid fa-images', event: 'window.open(`https://www.google.com.hk/searchbyimage?image_url=${__link__}`)', group: 'elementImage'}

    articlePage:
      - {id: 'printMode', name: '打印页面', icon: 'fa-solid fa-print', event: 'printMode', group: 'articlePage'}
      - {id: 'readMode', name: '阅读模式', icon: 'fa-solid fa-book-open', event: 'readMode', group: 'articlePage'}
  menus:
    darkMode:
      - {id: 'darkMode', name: '暗黑模式', icon: 'fa-solid fa-moon', event: 'volantis.dark.toggle()', group: 'darkMode'}

环境信息

node.js & npm

``` v16.20.0 9.8.0 ```

Tikas commented 11 months ago

这段回复是个人猜想的结果,未经过实际运行环境检验,仅作参考!

看配置,里面有这一段:

rightmenus:
  enable: true
  order:
    - plugins.navigation
    - hr
...
    - menus.link
    - hr
...

查阅官方文档:

菜单的具体加载由 order 控制,可供使用的内容为:plugins.[组名], menus.[组名], hr, music 这四大类。

menus.[组名] 结合配置文件,menus 下面应该有 link 组,不知道是否有配置,还是复制配置文件时没能复制到。

bolnk commented 11 months ago

您好,多谢回答,这里我没有粘贴link,其实是有link的(因为设计隐私,我就没粘贴,以为会没影响)。

  menus:
    link:
      - {id: 'contributors', name: '加入群聊', icon: 'fa-solid fa-code-branch', link: '群聊链接', group: 'link'}
    darkMode:
      - {id: 'darkMode', name: '暗黑模式', icon: 'fa-solid fa-moon', event: 'volantis.dark.toggle()', group: 'darkMode'}

我记得刚开始还是好好的,后面无缘无故就这样了。

是不是我下载的包的缘故,因为后续我又安装了几个包。

    "hexo": "^6.3.0",
    "hexo-generator-archive": "^2.0.0",
    "hexo-generator-category": "^2.0.0",
    "hexo-generator-index": "^3.0.0",
    "hexo-generator-json-content": "^4.2.3",
    "hexo-generator-tag": "^2.0.0",
    "hexo-renderer-ejs": "^2.0.0",
    "hexo-renderer-marked": "^6.0.0",
    "hexo-renderer-stylus": "^2.1.0",
    "hexo-server": "^3.0.0",
    "hexo-theme-landscape": "^1.0.0",
    "hexo-theme-volantis": "^5.8.0",
    "hexo-wordcount": "^6.0.1"
Tikas commented 11 months ago

首次实机测试未发现问题

本次测试使用官方 Dome,对 _config 只作关键部分修改,经过测试,hexo s 运行后,没有发现任何问题。

测试环境

日期:2023 年 07 月 14 日 时间:上午 08:20 系统:Windows 10 loT LTSC 21H2 nodejs: 18.16.0 hexo: 5.4.2 hexo-cli: 4.3.1 npm: 9.5.1 Volantis: 5.8.0

测试过程

1、下载官方 Dome

https://github.com/volantis-x/demo

2、在 demo 目录里执行 git 操作

npm i hexo-theme-volantis

npm i

npm i hexo

npx hexo s
查看 git bash 完整过程

```bash Tikas@DESKTOP-0MSAEUO MINGW64 ~/Downloads/demo-master $ npm i hexo-theme-volantis npm WARN deprecated cuid@2.1.8: Cuid and other k-sortable and non-cryptographic ids (Ulid, ObjectId, KSUID, all UUIDs) are all insecure. Use @paralleldrive/cuid 2 instead. npm WARN deprecated source-map-resolve@0.6.0: See https://github.com/lydell/sour ce-map-resolve#deprecated npm WARN deprecated w3c-hr-time@1.0.2: Use your platform's native performance.no w() and performance.timeOrigin. added 236 packages, and audited 237 packages in 21s 20 packages are looking for funding run `npm fund` for details found 0 vulnerabilities npm notice npm notice New minor version of npm available! 9.5.1 -> 9.8.0 npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.8.0 npm notice Run npm install -g npm@9.8.0 to update! npm notice Tikas@DESKTOP-0MSAEUO MINGW64 ~/Downloads/demo-master $ npm i up to date, audited 237 packages in 1s 20 packages are looking for funding run `npm fund` for details found 0 vulnerabilities Tikas@DESKTOP-0MSAEUO MINGW64 ~/Downloads/demo-master $ hexo s bash: hexo: command not found Tikas@DESKTOP-0MSAEUO MINGW64 ~/Downloads/demo-master $ npm i hexo up to date, audited 237 packages in 1s 20 packages are looking for funding run `npm fund` for details found 0 vulnerabilities Tikas@DESKTOP-0MSAEUO MINGW64 ~/Downloads/demo-master $ npx hexo s INFO Validating config INFO ============================================================ Volantis 5.8.0 Docs: https://volantis.js.org/ Repo: https://github.com/volantis-x/hexo-theme-volantis/ ============================================================ INFO Start processing INFO Checking environment configuration... INFO Hexo is running at http://localhost:4000/ . Press Ctrl+C to stop. INFO Check environment configuration success! INFO Farewell ```

此时,整个本地 Demo 是能正常跑起来的。

接下来配置 _config

3、把右键菜单配置同步

先去 node_modules\hexo-theme-volantis 复制 _config.yml 到 Demo 目录,并重命名为:_config.volantis.yml

配置里面的右键菜单部分,下面是仅修改的部分

rightmenus:
  enable: true
  order:
    - plugins.navigation
    - hr
    - plugins.inputBox
    - plugins.seletctText
    - plugins.elementCheck
    - plugins.elementImage
    - menus.link
    - hr
    - menus.darkMode
    - plugins.articlePage
  options:
    musicAlwaysShow: false
  menus:
    link:
      - {id: 'contributors', name: '加入群聊', icon: 'fa-solid fa-code-branch', link: '群聊链接', group: 'link'}
查看完整的 _config.volantis.yml 配置

```bash ############################### Volantis ############################### info: theme_name: Volantis # This is theme's name. theme_docs: https://volantis.js.org/ # This is theme's URL. theme_repo: https://github.com/volantis-x/hexo-theme-volantis # Debug 调试模式 debug: env # false: 关闭调试模式, env:环境配置检查, pjax:调试pjax,rightMenus: 调试右键 ############################### 默认占位图 ############################### default: avatar: volantis-static/media/placeholder/avatar/round/3442075.svg # https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/avatar/round/3442075.svg link: volantis-static/media/placeholder/link/8f277b4ee0ecd.svg # https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/link/8f277b4ee0ecd.svg cover: volantis-static/media/placeholder/cover/76b86c0226ffd.svg # https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/cover/76b86c0226ffd.svg image: volantis-static/media/placeholder/image/2659360.svg # https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/image/2659360.svg ############################### CSP ############################### # 内容安全策略( CSP ) meta 标签 http-equiv="Content-Security-Policy" # https://developer.mozilla.org/zh-CN/docs/Web/HTTP/CSP # https://content-security-policy.com/ # 也可以设为 false 在 HTTP 标头中设置 https://volantis.js.org/v5/advanced-settings/#设置-HTTP-响应标头 csp: enable: true content: " default-src 'self' https:; block-all-mixed-content; base-uri 'self' https:; form-action 'self' https:; worker-src 'self' https:; connect-src 'self' https: *; img-src 'self' data: https: *; media-src 'self' https: *; font-src 'self' data: https: *; frame-src 'self' https: *; manifest-src 'self' https: *; child-src https:; script-src 'self' https: 'unsafe-inline' *; style-src 'self' https: 'unsafe-inline' *; " # 可以使用自动程序替换默认的 'unsafe-inline' 和 * 生成更严格的内容安全策略. # 另可以参考官网的 gulp 方案. # gulpfile.js https://github.com/volantis-x/community/blob/main/gulpfile.js ############################### CDN ############################### # 本地静态文件使用 CDN 加速 # 默认使用 https://unpkg.com/hexo-theme-volantis@<%- theme.info.theme_version %>/source/js/*.js ,注意版本号对应关系!!可以通过修改以下配置项覆盖 # 开发者注意 cdn.enable 设置为 false cdn: enable: false # CDN 前缀,为空使用默认值,链接最后不加 "/", # 例如: https://cdn.jsdelivr.net/gh/volantis-x/volantis-x.github.io@gh-page 填写最后编译生成的源码CDN地址前缀,此路径下应该含有/js与/css目录, # 该配置默认值是:"https://unpkg.com/hexo-theme-volantis@"+ theme.info.theme_version +"/source" prefix: #https://unpkg.com/hexo-theme-volantis/source # 以下配置可以覆盖 cdn.prefix,配置项的值可以为空,但是要使用CDN必须依据路径填写配置项的键 set: js: #app: /js/app.js css: #style: /css/style.css # (异步加载样式) # 静态资源版本控制 # 本地文件使用文件内容的hash值作为版本号(app.8c1e7c88.js) 其他为时间戳 (?time=1648684470140) # 建议静态资源设置标头 浏览器缓存一年边缘缓存一个月 cache-control: max-age=86400, s-maxage=31536000 如果有更新记得刷新缓存 cdn_version: false # volantis static 静态资源文件 npm 包 CDN 地址 (后面加 "/" ) # https://github.com/volantis-x/volantis-static volantis_static_cdn: https://unpkg.com/volantis-static@0.0.1654736714924/ ######################################################################## # https://web.dev/content-visibility/ # https://www.caniuse.com/?search=content-visibility content_visibility: false # 全局页面字符串替换 A => B (可用于临时修改错字等) replace: - https://cdn.jsdelivr.net/npm/ => https://unpkg.com/ - https://cdn.jsdelivr.net/gh/ => https://gcore.jsdelivr.net/gh/ # dns-prefetch preconnect x-dns-prefetch-control dns_prefetch: - https://unpkg.com # 平滑滚动效果 scroll_smooth: true ############################### Navigation Bar ############################### > start # 注意事项:建议规范全站路径 URL 最后带一个 "/" 例如 "about/" navbar: visiable: auto # always, auto logo: # choose [img] or [icon + title] img: volantis-static/media/org.volantis/blog/Logo-NavBar@3x.png # https://cdn.jsdelivr.net/gh/volantis-x/cdn-org/blog/Logo-NavBar@3x.png icon: title: menu: - name: 博客 icon: fa-solid fa-rss url: / - name: 分类 icon: fa-solid fa-folder-open url: categories/ - name: 标签 icon: fa-solid fa-tags url: tags/ - name: 归档 icon: fa-solid fa-archive url: archives/ - name: 友链 icon: fa-solid fa-link url: friends/ - name: 关于 icon: fa-solid fa-info-circle url: about/ search: Search... # Search bar placeholder ############################### Navigation Bar ############################### > end ############################### Cover ############################### > start cover: height_scheme: full # full, half layout_scheme: dock # blank (留白), search (搜索), dock (坞), featured (精选), focus (焦点) display: home: true archive: true others: false # can be written in front-matter 'cover: true' background: https://gcore.jsdelivr.net/gh/MHG-LAB/cron@gh-pages/bing/bing.jpg # background: https://bing.ioliu.cn/v1/rand?w=1920&h=1200 logo: # https://cdn.jsdelivr.net/gh/volantis-x/cdn-org/blog/Logo-Cover@3x.png title: 'Volantis' subtitle: '' search: A Wonderful Theme for Hexo # search bar placeholder features: - name: 文档 icon: # img: volantis-static/media/twemoji/assets/svg/1f5c3.svg # https://cdn.jsdelivr.net/gh/twitter/twemoji@13.0/assets/svg/1f5c3.svg url: /v4/getting-started/ - name: 帮助 icon: # img: volantis-static/media/twemoji/assets/svg/1f516.svg # https://cdn.jsdelivr.net/gh/twitter/twemoji@13.0/assets/svg/1f516.svg url: faqs/ - name: 示例 icon: # img: volantis-static/media/twemoji/assets/svg/1f396.svg # https://cdn.jsdelivr.net/gh/twitter/twemoji@13.0/assets/svg/1f396.svg url: /examples/ - name: 社区 icon: # img: volantis-static/media/twemoji/assets/svg/1f389.svg # https://cdn.jsdelivr.net/gh/twitter/twemoji@13.0/assets/svg/1f389.svg url: /contributors/ - name: 博客 icon: # img: volantis-static/media/twemoji/assets/svg/1f4f0.svg # https://cdn.jsdelivr.net/gh/twitter/twemoji@13.0/assets/svg/1f4f0.svg url: /archives/ - name: 源码 icon: # img: volantis-static/media/twemoji/assets/svg/1f9ec.svg # https://cdn.jsdelivr.net/gh/twitter/twemoji@13.0/assets/svg/1f9ec.svg url: https://github.com/volantis-x/hexo-theme-volantis/ ############################### Cover ############################### > end pages: # 友链页面配置 friends: layout_scheme: traditional # simple: 简单布局, traditional: 传统布局 ############################### Article Layout ############################### > start # 文章布局 article: # 文章列表页面的文章卡片布局方案 preview: scheme: landscape # landscape # pin icon for post pin_icon: volantis-static/media/twemoji/assets/svg/1f4cc.svg # https://cdn.jsdelivr.net/gh/twitter/twemoji@13.0/assets/svg/1f4cc.svg # auto generate title if not exist auto_title: true # false, true # auto generate excerpt if not exist auto_excerpt: true # false, true # hide excerpt hide_excerpt: false # show split line or not line_style: solid # hidden, solid, dashed, dotted # show author author: false # true, false # show readmore button readmore: auto # auto, always # 文章详情页面的文章卡片本体布局方案 body: # 文章顶部信息 # 从 meta_library 中取 top_meta: [author, category, date, counter] #启用评论数量需在此添加 # 文章底部信息 # 从 meta_library 中取 bottom_meta: [updated, tags, share] # ---------------- # 文章页脚组件 footer_widget: # ---------------- # 参考资料、相关资料等 (for layout: post/docs) references: title: 参考资料 icon: fa-solid fa-quote-left # 在 front-matter 中: # references: # - title: 某篇文章 # url: https:// # 即可显示此组件。 # ---------------- # 相关文章,需要安装插件 (for layout: post) # npm i hexo-related-popular-posts related_posts: enable: false title: 相关文章 icon: fa-solid fa-bookmark max_count: 5 # 设为空则不使用文章头图 placeholder_img: https://gcore.jsdelivr.net/gh/MHG-LAB/cron@gh-pages/bing/bing.jpg # ---------------- # 版权声明组件 (for layout: post) copyright: enable: false permalink: '本文永久链接是:' content: - '博客内容遵循 署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0) 协议' - permalink # 自定义版权组件:精细到文章的版权声明 custom: false # 开启后替代上方内容的版权显示 customData: default: type1 # 默认授权声明 ############################# # 你可以在文章的 front-matter 覆盖默认版权声明 # 配置示例(均可选): # copyright: # type: type3 # 当前文章版权声明类型 # author: 张三 # 本文作者 # ref: # 原文出处 # title: # 原文出处 - 标题 # url: # 原文出处 - 链接 ############################# rules: type1: text: CC BY-NC-SA 4.0 desc: 署名-非商业性使用-相同方式共享 4.0 国际。 type2: text: 禁止转载引用 desc: 除非获得原作者的单独授权,任何第三方不得转载! type3: text: 原作许可协议 desc: 本文转载自他站,转载或引用本文时,请遵守原作许可协议! type4: text: 来自互联网 desc: 本文来自互联网,未知来源,侵权请联系删除。 type5: text: 允许规范转载 desc: 转载请保留本文转载地址,著作权归作者所有! type6: text: 允许付费转载 desc: 您可以联系作者通过付费方式获得授权。 # 还能自行添加更多 # ---------------- # 打赏组件 (for layout: post) donate: enable: false images: - volantis-static/media/org.volantis/blog/qrcode/github@volantis.png # https://cdn.jsdelivr.net/gh/volantis-x/cdn-org/blog/qrcode/github@volantis.png - volantis-static/media/org.volantis/blog/qrcode/github@volantis.png # https://cdn.jsdelivr.net/gh/volantis-x/cdn-org/blog/qrcode/github@volantis.png # meta library meta_library: # 默认文章作者(可在 _data/author.yaml 中增加其他作者,并在 front-matter 中设置) # https://volantis.js.org/advanced-settings/#多人协同 author: avatar: volantis-static/media/org.volantis/blog/favicon/apple-touch-icon.png # https://cdn.jsdelivr.net/gh/volantis-x/cdn-org/blog/favicon/apple-touch-icon.png name: 请设置文章作者 url: / # 文章创建日期 date: icon: fa-solid fa-calendar-alt title: '发布于:' format: 'll' # 日期格式 http://momentjs.com/docs/ # 文章更新日期 updated: icon: fa-solid fa-edit title: '更新于:' format: 'll' # 日期格式 http://momentjs.com/docs/ # 文章分类 category: icon: fa-solid fa-folder-open # 文章浏览计数 counter: icon: fa-solid fa-eye unit: '次浏览' # waline 文章评论数量 walinecount: icon: fa-solid fa-comment-dots desc: '条评论' # 条评论 # artalk 文章评论数量 artalkcount: icon: fa-solid fa-comment-dots desc: '条评论' # 条评论 # 文章字数和阅读时长 wordcount: icon_wordcount: fa-solid fa-keyboard icon_duration: fa-solid fa-hourglass-half # 文章标签 tags: icon: fa-solid fa-hashtag # 分享 share: - id: qq img: volantis-static/media/org.volantis/logo/128/qq.png # https://cdn.jsdelivr.net/gh/volantis-x/cdn-org/logo/128/qq.png - id: qzone img: volantis-static/media/org.volantis/logo/128/qzone.png # https://cdn.jsdelivr.net/gh/volantis-x/cdn-org/logo/128/qzone.png - id: weibo img: volantis-static/media/org.volantis/logo/128/weibo.png # https://cdn.jsdelivr.net/gh/volantis-x/cdn-org/logo/128/weibo.png - id: # qrcode # 当id为qrcode时需要安装插件 npm i hexo-helper-qrcode img: # volantis-static/media/org.volantis/logo/128/wechat.png # https://cdn.jsdelivr.net/gh/volantis-x/cdn-org/logo/128/wechat.png - id: # telegram img: # volantis-static/media/org.volantis/logo/128/telegram.png # https://cdn.jsdelivr.net/gh/volantis-x/cdn-org/logo/128/telegram.png ############################### Article Layout ############################### > end ############################### Comments ############################### > start comments: title: 评论 subtitle: service: giscus # 可选评论系统 # # artalk # https://artalk.js.org/ # https://github.com/ArtalkJS/Artalk artalk: js: https://yours-artalk-domain/dist/Artalk.js # or https://unpkg.com/artalk@2.2.8/dist/Artalk.js css: https://yours-artalk-domain/dist/Artalk.css # or https://unpkg.com/artalk@2.2.8/dist/Artalk.css server: https://yours-artalk-domain # 修改为自建的后端服务地址 path: # 全局评论地址 placeholder: # 评论占位 # artalk 有三类图片:1.上传至服务端 2.上传至服务端后利用upgit上传至图床 3.前端上传至图床(本配置为此类) # 配置此项时将覆盖服务端上传能力 imageUploader: # 以兰空图床为例,下列填写内容为: # url: 'https://xxxxxx/api/v1/upload' # token: 'Bearer xxxxxxxxxxxxxx' # resp: 'data.links.url' api: # 图床地址 token: # 图床验证 resp: # 图片地址返回值的字段 # 更多置项可在 Artalk 后端进行配置,详见 https://artalk.js.org/guide/backend/fe-control.html # 也可以在此处继续参考上方例子进行配置,不建议重写配置的字段除上方所述外还有: # [el, useBackendConf, pageKey, pageTitle, site, darkMode, pvEl, imgUploader] # giscus # https://giscus.app # https://github.com/laymonage/giscus giscus: # 以下配置按照 yml 格式增删填写即可 # repo: xxx/xxx # repo-id: xxx # category: xxx # category-id: xxx # mapping: "pathname" # reactions-enabled: "1" # emit-metadata: "0" # lang: "zh-CN" # 以上配置按照 yml 格式增删填写即可 theme: light: "light" # https://cdn.jsdelivr.net/gh/volantis-x/cdn-volantis@master/css/giscus/light.css dark: "dark" # https://cdn.jsdelivr.net/gh/volantis-x/cdn-volantis@master/css/giscus/dark.css # beaudar # https://beaudar.lipk.org/ beaudar: repo: xxx/xxx issue-term: pathname issue-number: branch: main position: top order: desc theme: light: github-light dark: github-dark label: ✨💬✨ # utterances # https://utteranc.es/ utterances: repo: xxx/xxx issue-term: pathname issue-number: theme: light: github-light dark: github-dark label: ✨💬✨ # Disqus # https://disqus.com disqus: shortname: # optional autoload: false path: # 全局评论地址 # DisqusJS # https://github.com/SukkaW/DisqusJS disqusjs: path: # 全局评论地址 js: https://unpkg.com/disqusjs@1.3/dist/disqus.js css: https://unpkg.com/disqusjs@1.3/dist/disqusjs.css # 配置项按照yml格式继续填写即可 除了 [siteName url identifier] 选项 #shortname: #api: #apikey: #admin: #nesting: # Gitalk # https://gitalk.github.io/ gitalk: js: https://unpkg.com/gitalk@1/dist/gitalk.min.js # 配置项按照yml格式继续填写即可 除了 [id distractionFreeMode] 选项 clientID: clientSecret: repo: owner: admin: # [] path: # 全局评论地址 # Vssue 暂不支持Pjax # https://vssue.js.org/zh/ vssue: js: https://cdn.jsdelivr.net/gh/meteorlxy/vssue@1.4.4/packages/vssue/dist/vssue.github.min.js css: https://cdn.jsdelivr.net/gh/meteorlxy/vssue@1.4.4/packages/vssue/dist/vssue.min.css vue: https://cdn.jsdelivr.net/gh/vuejs/vue@2.6.11/dist/vue.runtime.min.js owner: repo: clientId: clientSecret: # LiveRe 暂不支持Pjax # https://www.livere.com livere: uid: # Isso # https://posativ.org/isso/ isso: url: https://example.com/(path/) src: https://example.com/(path/)js/embed.min.js css: gravatar: # HashOver 暂不支持Pjax # https://www.barkdull.org/software/hashover hashover: src: https://example.com/(path/)comments.php # Twikoo # https://twikoo.js.org/ twikoo: js: https://unpkg.com/twikoo@latest # 建议锁定版本 path: # 全局评论地址 # 其他配置项按照yml格式继续填写即可 除了 [el path] 选项 envId: xxxxxxxxxxxxxxx # 腾讯云环境id placeholder: #全局评论占位,也可以在管理面板中的配置管理处设置(此处优先级更高) # Waline # https://waline.js.org/ waline: js: https://unpkg.com/@waline/client@v2/dist/waline.js css: https://unpkg.com/@waline/client@v2/dist/waline.css path: # 全局评论地址 目前设置全局评论地址后visitor失效,这是waline的问题 placeholder: # 评论占位提示 serverURL: # Waline 的服务端地址(必填) 测试用地址: https://waline.vercel.app imageUploader: # 以兰空图床为例,下列填写内容为: # url: https://xxxxxx/api/v1/upload # token: Bearer xxxxxxxxxxxxxx # resp: data.links.url api: # 图床地址 token: # 图床验证 resp: # 图片地址返回值的字段 pageview: true # 浏览量统计 comment: true # 评论数统计 # 其他配置项按照yml格式继续填写即可 除了 [el path imageUploader] 选项 # 组件属性地址:https://waline.js.org/reference/component.html # meta: ['nick', 'mail', 'link'] # Discuss # https://discuss.js.org discuss: js: https://cdn.jsdelivr.net/npm/discuss/dist/discuss.js # 建议锁定版本 serverURLs: # Discuss server address url # https://discuss.js.org/Quick-Start.html#path ############################### Comments ############################### > end ############################### Sidebar ############################### > start sidebar: position: right # left right # 主页、分类、归档等独立页面 for_page: [blogger, category, tagcloud, donate] # layout: docs/post 这类文章页面 for_post: [toc] # 侧边栏组件库 widget_library: # --------------------------------------- # blogger info widget blogger: class: blogger display: [desktop, mobile] # [desktop, mobile] avatar: volantis-static/media/org.volantis/blog/Logo-NavBar@3x.png # https://cdn.jsdelivr.net/gh/volantis-x/cdn-org/blog/Logo-NavBar@3x.png shape: rectangle # circle, rectangle url: /about/ title: subtitle: jinrishici: true # Poetry Today. You can set a string, and it will be displayed when loading fails. social: - icon: fa-solid fa-rss url: /atom.xml - icon: fa-solid fa-envelope url: mailto:me@xxx.com - icon: fab fa-github url: https://github.com/volantis-x/ - icon: fa-solid fa-headphones-alt url: / # --------------------------------------- # toc widget (valid only in articles) toc: class: toc display: [desktop, mobile] # [desktop, mobile] sticky: true header: icon: fa-solid fa-list title: 本文目录 list_number: false min_depth: 2 max_depth: 5 # --------------------------------------- # music music: class: music display: [desktop, mobile] # [desktop, mobile] pjaxReload: false # --------------------------------------- # category widget category: class: category display: [desktop] # [desktop, mobile] header: icon: fa-solid fa-folder-open title: 文章分类 url: /blog/categories/ # --------------------------------------- # tagcloud widget tagcloud: class: tagcloud display: [desktop, mobile] # [desktop, mobile] header: icon: fa-solid fa-tags title: 热门标签 url: /blog/tags/ min_font: 14 max_font: 24 color: true start_color: '#999' end_color: '#555' # --------------------------------------- # qrcode widget qrcode: class: qrcode display: [desktop, mobile] # [desktop, mobile] height: 64px # Automatic height if not set images: - volantis-static/media/org.volantis/blog/qrcode/github@volantis.png # https://cdn.jsdelivr.net/gh/volantis-x/cdn-org/blog/qrcode/github@volantis.png - volantis-static/media/org.volantis/blog/qrcode/github@volantis.png # https://cdn.jsdelivr.net/gh/volantis-x/cdn-org/blog/qrcode/github@volantis.png # --------------------------------------- # webinfo widget webinfo: class: webinfo display: [desktop] header: icon: fa-solid fa-award title: 站点信息 type: article: enable: true text: '文章数目:' unit: '篇' runtime: enable: false data: '2020/01/01' # 填写建站日期 text: '已运行时间:' unit: '天' wordcount: enable: false text: '本站总字数:' # 需要启用 wordcount unit: '字' visitcounter: siteuv: enable: false text: '本站访客数:' unit: '人' sitepv: enable: false text: '本站总访问量:' unit: '次' lastupd: enable: true friendlyShow: true # 更友好的时间显示 text: '最后活动时间:' unit: '日' # --------------------------------------- # lastupdate widget lastupdate: class: lastupdate display: [desktop, mobile] header: icon: fa-solid fa-clock WISTERIA title: 最近更新 ############################### Sidebar ############################### > end ############################### Tag Plugins ############################### > start # 内置标签插件的配置 tag_plugins: # {% note text %} note: # style for default note: icon: '\f054' color: '' iconfont: 'Font Awesome 6 Free' # {% checkbox %} checkbox: interactive: false # enable interactive for user color: '' # color for default checkbox # {% link title, url, img %} link: placeholder: volantis-static/media/org.volantis/logo/256/safari.png # https://cdn.jsdelivr.net/gh/volantis-x/cdn-org/logo/256/safari.png ############################### Tag Plugins ############################### > end ############################### Site Footer ############################### > start site_footer: # layout of footer: [aplayer, social, license, info, copyright] layout: [aplayer, social, license, analytics, info, copyright] social: - icon: #fa-solid fa-rss url: # or - img: url: # or - avatar: url: # site source source: https://github.com/volantis-x/volantis-docs/ # analytics using leancloud analytics: > 本站总访问量为 访客数为 # site copyright copyright: '[Copyright © since 2017 XXX](/)' # You can add your own property here. (Support markdown, for example: br: '
') br: '
' ############################### Site Footer ############################### > end ############################### Plugins ############################### > start plugins: ################ required plugins ################ # jquery globalJquery: false # 全局引入 jquery jquery: volantis-static/libs/jquery/dist/jquery.min.js # https://unpkg.com/jquery@3.6.0/dist/jquery.min.js # fontawesome Pro 版本:https://cdn.jsdelivr.net/gh/inkss/fontawesome@6.0.0/css/all.min.css fontawesome: volantis-static/libs/@fortawesome/fontawesome-free/css/all.min.css # https://unpkg.com/@fortawesome/fontawesome-free@6.1/css/all.min.css # katex@0.15.2 katex: js: volantis-static/libs/katex/katex.min.js # https://unpkg.com/katex@0.15.2/dist/katex.min.js css: volantis-static/libs/katex/katex.min.css # https://unpkg.com/katex@0.15.2/dist/katex.min.css render: volantis-static/libs/katex/contrib/auto-render.min.js # https://unpkg.com/katex@0.15.2/dist/contrib/auto-render.min.js # mathjax@3.2.0 mathjax: volantis-static/libs/mathjax/es5/tex-mml-chtml.js # https://unpkg.com/mathjax@3.2.0/es5/tex-mml-chtml.js # github-markdown-css@5.1.0 markdown: volantis-static/libs/github-markdown-css/github-markdown.css # https://unpkg.com/github-markdown-css@5.1.0/github-markdown.min.css # marked@4.0.10 marked: volantis-static/libs/marked/marked.min.js # https://unpkg.com/marked@4.0.10/marked.min.js # hls.js@1.1.3 hlsjs: volantis-static/libs/hls.js/dist/hls.min.js # https://unpkg.com/hls.js@1.1.3 # @fancyapps/ui@4.0.12 fancybox: css: volantis-static/libs/@fancyapps/ui/dist/fancybox.css # https://unpkg.com/@fancyapps/ui@4.0.12/dist/fancybox.css js: volantis-static/libs/@fancyapps/ui/dist/fancybox.umd.js # https://unpkg.com/@fancyapps/ui@4.0.12/dist/fancybox.umd.js ################ optional plugins ################ # issues api sitesjs: enable: true friendsjs: enable: true contributorsjs: enable: true ######## Plugins to improve loading speed: # 预加载 preload: enable: true service: flying_pages # instant_page, flying_pages instant_page: volantis-static/libs/instant_page/instant_page.js # https://cdn.jsdelivr.net/gh/volantis-x/cdn-volantis@2/js/instant_page.js flying_pages: volantis-static/libs/flying-pages/flying-pages.min.js # https://cdn.jsdelivr.net/gh/gijo-varghese/flying-pages@2.1.2/flying-pages.min.js # 图片懒加载 # https://www.npmjs.com/package/vanilla-lazyload # tips: # 这里是主题自带的图片懒加载, 实现方案位于 /scripts/filters/z-lazyload ; srcset 属性的的优先级比 src 属性要高, 注意 srcset 存放了懒加载占位图, src 存放了原图 # 在支持 srcset 的浏览器或者 RSS 阅读器(还会有人使用老旧的阅读器?)上会优先读取 srcset 加载的图片(懒加载占位图), 对于 RSS 中图片丢失变成懒加载占位图的问题, 建议 自行使用脚本移除 srcset 属性 或 关闭图片懒加载 或 在 RSS 中插入 vanilla-lazyload lazyload: enable: true js: volantis-static/libs/vanilla-lazyload/dist/lazyload.min.js # https://unpkg.com/vanilla-lazyload@17.1.0/dist/lazyload.min.js onlypost: false loadingImg: # https://cdn.jsdelivr.net/gh/volantis-x/cdn-volantis@3/img/placeholder/c617bfd2497fcea598e621413e315c368f8d8e.svg # 不建议使用占位图, 建议loadingImg为空, 当前占位图会产生布局偏移, loadingImg 为空占位图是一个 1X1 像素的图片 blurIn: true # 模糊加载效果 (loadingImg为空时有效) ######## Plugins to optimize the experience: # 代码高亮 code_highlight: highlightjs # highlightjs or prismjs # highlight.js highlightjs: copy_code: true # 如果开启以下配置, hexo.config.highlight.enable 需要设置为 false ; hexo.config.highlight.enable 设置为 true, 则以下配置无效 # # 不再支持 v11.1.0 以下版本 # js: https://unpkg.com/@highlightjs/cdn-assets@11.5.1/highlight.min.js # Please set hexo.config.highlight.enable = false !!! # css: https://unpkg.com/@highlightjs/cdn-assets@11.5.1/styles/default.min.css # # # more: https://www.jsdelivr.com/package/npm/@highlightjs/cdn-assets?path=styles # prismjs # https://prismjs.com/ # https://hexo.io/zh-cn/docs/syntax-highlight#PrismJS prismjs: copy_code: true # Please set hexo.config.highlight.enable = false !!! set hexo.config.prismjs.enable = true !!! js: - https://unpkg.com/prismjs/components/prism-core.min.js - https://unpkg.com/prismjs/plugins/autoloader/prism-autoloader.min.js - https://unpkg.com/prismjs/plugins/line-numbers/prism-line-numbers.min.js css: - https://unpkg.com/prismjs/themes/prism-dark.css - https://unpkg.com/prismjs/plugins/line-numbers/prism-line-numbers.css # https://scrollrevealjs.org/api/reveal.html scrollreveal: enable: #true js: volantis-static/libs/scrollreveal/dist/scrollreveal.min.js # https://unpkg.com/scrollreveal@4.0.9/dist/scrollreveal.min.js distance: 32px duration: 800 # ms interval: 20 # ms scale: 1 # 0.1~1 ######## Plugins for SEO: # npm i hexo-wordcount wordcount: enable: #true ######## Plugins for ... # Button Ripple Effect nodewaves: enable: #true css: volantis-static/libs/node-waves/dist/waves.min.css # https://unpkg.com/node-waves@0.7.6/dist/waves.min.css js: volantis-static/libs/node-waves/dist/waves.min.js # https://unpkg.com/node-waves@0.7.6/dist/waves.min.js # fontawesome V6: https://fontawesome.com/docs/web/style/animate # fontawesome animation for fontawesome V5 fontawesome_animation: enable: #true css: volantis-static/libs/font-awesome-animation/font-awesome-animation.min.css # https://cdn.jsdelivr.net/gh/l-lin/font-awesome-animation/dist/font-awesome-animation.min.css # Typing Effects comment_typing: enable: #true js: volantis-static/libs/comment_typing/comment_typing.js # https://cdn.jsdelivr.net/gh/volantis-x/cdn-volantis@2/js/comment_typing.js # 视差滚动效果 Slide Background parallax: enable: #true position: cover # cover: sticky on the cover. fixed: Fixed as background for the site. shuffle: true # shuffle playlist duration: 10000 # Duration (ms) fade: 1500 # fade duration (ms) (Not more than 1500) images: # For personal use only. At your own risk if used for commercial purposes !!! - volantis-static/media/wallpaper/minimalist/2020/001.webp - volantis-static/media/wallpaper/minimalist/2020/002.webp - volantis-static/media/wallpaper/minimalist/2020/003.webp - volantis-static/media/wallpaper/minimalist/2020/004.webp - volantis-static/media/wallpaper/minimalist/2020/005.webp - volantis-static/media/wallpaper/minimalist/2020/006.webp - volantis-static/media/wallpaper/minimalist/2020/012.webp - volantis-static/media/wallpaper/minimalist/2020/016.webp - volantis-static/media/wallpaper/minimalist/2020/019.webp - volantis-static/media/wallpaper/minimalist/2020/025.webp - volantis-static/media/wallpaper/minimalist/2020/033.webp - volantis-static/media/wallpaper/minimalist/2020/034.webp - volantis-static/media/wallpaper/minimalist/2020/035.webp - volantis-static/media/wallpaper/minimalist/2020/038.webp - volantis-static/media/wallpaper/minimalist/2020/039.webp - volantis-static/media/wallpaper/minimalist/2020/042.webp - volantis-static/media/wallpaper/minimalist/2020/046.webp - volantis-static/media/wallpaper/minimalist/2020/051.webp - volantis-static/media/wallpaper/minimalist/2020/052.webp - volantis-static/media/wallpaper/minimalist/2020/054.webp - volantis-static/media/wallpaper/minimalist/2020/056.webp # APlayer is only available in mainland China. # APlayer config: https://github.com/metowolf/MetingJS aplayer: enable: #true js: aplayer: volantis-static/libs/aplayer/dist/APlayer.min.js # https://unpkg.com/aplayer@1.10/dist/APlayer.min.js meting: volantis-static/libs/meting/dist/Meting.min.js # https://unpkg.com/meting@2.0/dist/Meting.min.js css: volantis-static/libs/aplayer/dist/APlayer.min.css # https://unpkg.com/aplayer@1.10/dist/APlayer.min.css # Required server: netease # netease, tencent, kugou, xiami, baidu type: playlist # song, playlist, album, search, artist id: 3175833810 # song id / playlist id / album id / search keyword # Optional fixed: false # enable fixed mode theme: '#1BCDFC' # main color autoplay: false # audio autoplay order: list # player play order, values: 'list', 'random' loop: all # player loop play, values: 'all', 'one', 'none' volume: 0.7 # default volume, notice that player will remember user setting, default volume will not work after user set volume themselves list_max_height: 320px # list max height list_folded: true autoHide: true # hide automaticaly # Pjax pjax: js: volantis-static/libs/pjax/pjax.min.js # https://unpkg.com/pjax@0.2.8/pjax.min.js enable: true cover: true # 封面是否pjax处理 false:每次切换页面封面都重载,适合封面较少的情况 true:封面经过Pjax处理,适合封面较多的情况 timeout: 5000 # The timeout in milliseconds for the XHR requests. Set to 0 to disable the timeout. cacheBust: false # When set to true, Pjax appends a timestamp to skip the browser cache. animation: false # false, nprogress, circle nprogress: volantis-static/libs/nprogress/nprogress.js # https://unpkg.com/nprogress@0.2.0/nprogress.min.js banUrl: # 被屏蔽的 url 地址将不启用 pjax 跳转,可以在控制台下使用 window.location.pathname 获取 # - '/artitalk/' # artitalk 不支持 pjax # - '/bbtalk/' # bbtalk 不支持 pjax # 暗黑模式 darkmode # 开关按钮:在 navbar.menu 中添加: # - name: 暗黑模式 # 可自定义 # icon: fa-solid fa-moon # 可自定义 # toggle: darkmode darkmode: enable: #true # 旧版 Internet Explorer 淘汰行动 # https://www.microsoft.com/zh-cn/WindowsForBusiness/End-of-IE-support # 本主题不支持Internet Explorer的任何版本!!! killOldVersionsOfIE: enable: true # 禁用JavaScript提示 # 本页面需要浏览器支持(启用)JavaScript # 主题中的某些插件必须启用JavaScript才能正常工作,例如开启scrollreveal如果禁用JavaScript会导致卡片消失 killNoScript: enable: true # Artitalk https://artitalk.js.org # 配置过程请参考:https://artitalk.js.org/doc.html # 使用过旧版本的请修改Leancloud shuoshuo class部分列名:https://artitalk.js.org/release.html # 除appID和appKEY外均为选填项 artitalk: # Set `plugins: ["artitalk"]` to enable in front-matter # 不支持 Pjax # 配置项按照yml格式继续填写即可 js: https://unpkg.com/artitalk appId: ogP8qj3veMh0LFpFWMPOyF0X-MdYXbMMI # your appID appKey: nHXLd3N3Jgh460t2iRQKWAtr # your appKEY # serverURL: #leancloud绑定的api访问域名,使用国际版的话不需要填写 # lang: # 语言设置,zh为汉语,en为英语,es为西班牙语。默认为汉语 # pageSize: #每页说说的显示数量 # shuoPla: #在编辑说说的输入框中的占位符 # avatarPla: #自定义头像url的输入框的占位符 # motion: #加载动画的开关,1为开,0为关,默认为开 # bgImg: #说说输入框背景图片url # color1: #说说背景颜色1&按钮颜色1 # color2: #说说背景颜色2&按钮颜色2 # color3: #说说字体颜色 # cssUrl: #自定义css接口 # BBtalk https://bb.js.org bbtalk: # Set `plugins: ["bbtalk"]` to enable in front-matter # 不支持 Pjax js: https://unpkg.com/bbtalk@0.1.5/dist/bbtalk.js # BBtalk.js appId: 0KzOX4vC7Jsk6vzUGNeEiUaI-gzGzoHsz # your appID appKey: HwCiWuxfpvKiLm4teCUgTIba # your appKEY serverURLs: https://bbapi.heson10.com # Request Api 域名 # 友链朋友圈 hexo-circle-of-friends # https://github.com/Rock-Candy-Tea/hexo-circle-of-friends # https://fcircle-doc.js.cool/ fcircle: # Set `plugins: ["fcircle"]` to enable in front-matter # 支持 Pjax api: https://fcircle-api.example.com/ # api 地址 message: 与主机通讯中…… # 占位文字 css: volantis-static/libs/fcircle/fcircle.css js: volantis-static/libs/fcircle/fcircle.js # 消息提示 # izitoast@1.4.0 message: enable: true css: volantis-static/libs/izitoast/dist/css/iziToast.min.css js: volantis-static/libs/izitoast/dist/js/iziToast.min.js icon: # 默认图标,支持对图标添加颜色,可选值:see:/source/css/_style/_plugins/fontcolor.styl default: fa-solid fa-info-circle light-blue quection: fa-solid fa-question-circle light-blue time: # 默认持续时间 default: 5000 quection: 20000 position: 'topRight' # 弹出位置 可选值:topRight, bottomRight, bottomLeft, topLeft, topCenter, bottomCenter, center transitionIn: 'bounceInLeft' # 弹窗打开动画 可选值:bounceInLeft, bounceInRight, bounceInUp, bounceInDown, fadeIn, fadeInDown, fadeInUp, fadeInLeft, fadeInRight, flipInX transitionOut: 'fadeOutRight' # 弹窗关闭动画 可选值:fadeOut, fadeOutUp, fadeOutDown, fadeOutLeft, fadeOutRight, flipOutX titleColor: 'var(--color-text)' # 标题颜色 messageColor: 'var(--color-text)' # 消息颜色 backgroundColor: 'var(--color-card)' # 默认背景色 zindex: 2147483647 # 层级 copyright: # 是否在复制时弹出版权提示,影响范围:ctrl+c、代码块复制按钮、右键复制选项 enable: true title: '知识共享许可协议' message: '请遵守 CC BY-NC-SA 4.0 协议。' icon: 'far fa-copyright light-blue' aplayer: # 是否开启音乐通知;播放、暂停、失败 时的图标 enable: true play: fa-solid fa-play pause: fa-solid fa-pause rightmenu: enable: true # 是否开启右键模块的消息通知 notice: true # 唤醒原右键菜单的通知 # 聊天功能 chat_service: # tidio or gitter # Tidio # https://www.tidio.com/ tidio: id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # Gitter # https://gitter.im gitter: room: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # swiper # https://www.swiper.com.cn/ swiper: enable: true css: volantis-static/libs/swiper/swiper-bundle.min.css # https://unpkg.com/swiper@6/swiper-bundle.min.css js: volantis-static/libs/swiper/swiper-bundle.min.js # https://unpkg.com/swiper@6/swiper-bundle.min.js ############################### Plugins ############################### > end ############################### Rightmenu ############################### > start ### 自定义右键 新 rightmenus: enable: true # 右键菜单项及加载顺序 # 内容示例:plugins.[组名], menus.[组名], hr(分割线,推荐去线留白), music(音乐控制器) order: - plugins.navigation - hr - plugins.inputBox - plugins.seletctText - plugins.elementCheck - plugins.elementImage - menus.link - hr - menus.darkMode - plugins.articlePage ############################ # - {id: '', name: '', icon: '', link: '', event: '', group: ''} # id: 唯一值 # name: 用于菜单名称显示 # icon: 用于菜单图标显示 # link: 跳转链接 # event: 事件,当输入内容不为内置事件时,作 JavaScript 代码执行 # group: 菜单项所处分组名称 # 注: # 1. link/event 二选一,同时出现时仅处理 link # 2. 内置事件列表: copyText, copyLink, copyPaste, copyAll, copyCut, copyImg, printMode, readMode # 3. 内置组列表:navigation, inputBox, seletctText, elementCheck, elementImage, articlePage # 4. plugins 列允许自定义组内项目 # 5. menus 列允许自定义组及其内容 # 6. 除 navigation 外的内置组,在显示时会隐藏含 link 属性的菜单项 ########################### # 基础项设置 options: # 图标前缀 fa-solid, fa-regular, fa-light, fa-thin, fa-duotone, fa-brands iconPrefix: fa-solid # 例外,在 articlePage 组显示时(文章页)时依旧显示含 link 属性的菜单项 articleShowLink: true # 当设定全局音乐播放器时,是否一直显示音乐控制菜单。false:仅当音乐播放时启用 musicAlwaysShow: false # 右键内置组,预置实现 plugins: # 导航组件 # 横向排列,共用一行,仅显示图标 (原则上支持的数量不限) navigation: - {id: 'left', name: '转到上一页', icon: 'fa-solid fa-arrow-left', event: 'history.back()', group: 'navigation'} - {id: 'right', name: '转到下一页', icon: 'fa-solid fa-arrow-right', event: 'history.forward()', group: 'navigation'} - {id: 'redo', name: '刷新当前页面', icon: 'fa-solid fa-redo', event: 'window.location.reload()', group: 'navigation'} - {id: 'up', name: '回到顶部', icon: 'fa-solid fa-arrow-up', event: 'VolantisApp.scrolltoElement(volantis.dom.bodyAnchor)', group: 'navigation'} #- {id: 'home', name: '回到首页', icon: 'fa-solid fa-home', link: '/', group: 'navigation'} # 文本输入框相关组件 # 生效于 input/textarea,粘贴、剪切、全选 inputBox: - {id: 'copyPaste', name: '粘贴文本', icon: 'fa-solid fa-paste', event: 'copyPaste', group: 'inputBox'} - {id: 'copyAll', name: '全选文本', icon: 'fa-solid fa-object-ungroup', event: 'copyAll', group: 'inputBox'} - {id: 'copyCut', name: '剪切文本', icon: 'fa-solid fa-cut', event: 'copyCut', group: 'inputBox'} # 文本选中类组件 # 生效于右键选中文本,__text__ 为选中的文本。 seletctText: - {id: 'copyText', name: '复制文本', icon: 'fa-solid fa-copy', event: 'copyText', group: 'seletctText'} - {id: 'searchWord', name: '站内搜索', icon: 'fa-solid fa-search', event: 'OpenSearch(__text__)', group: 'seletctText'} - {id: 'bingSearch', name: '必应搜索', icon: 'fa-solid fa-search', event: 'window.open(`https://cn.bing.com/search?q=${__text__}`)', group: 'seletctText'} #- {id: 'googleSearch', name: '谷歌搜索', icon: 'fa-solid fa-search', event: 'window.open(`https://www.google.com/search?q=${__text__}`)', group: 'seletctText'} # 链接判断组件 # 生效于链接处的右键行为,__link__ 为链接地址 elementCheck: - {id: 'openTab', name: '新标签页打开', icon: 'fa-solid fa-external-link-square-alt', event: 'window.open(__link__)', group: 'elementCheck'} - {id: 'copyLink', name: '复制链接地址', icon: 'fa-solid fa-link', event: 'copyLink', group: 'elementCheck'} # 图片判断类组件 # 生效于图片类的右键行为,__link__ 为链接地址 elementImage: - {id: 'copyImg', name: '复制图片', icon: 'fa-solid fa-image', event: 'copyImg', group: 'elementImage'} - {id: 'googleImg', name: '谷歌识图', icon: 'fa-solid fa-images', event: 'window.open(`https://www.google.com.hk/searchbyimage?image_url=${__link__}`)', group: 'elementImage'} # 文章页面组件 # 生效于 post.article 页面 articlePage: - {id: 'printMode', name: '打印页面', icon: 'fa-solid fa-print', event: 'printMode', group: 'articlePage'} - {id: 'readMode', name: '阅读模式', icon: 'fa-solid fa-book-open', event: 'readMode', group: 'articlePage'} # 右键自定义菜单区域 menus: link: - {id: 'contributors', name: '加入群聊', icon: 'fa-solid fa-code-branch', link: '群聊链接', group: 'link'} darkMode: - {id: 'darkMode', name: '暗黑模式', icon: 'fa-solid fa-moon', event: 'volantis.dark.toggle()', group: 'darkMode'} ### # 自定义右键菜单 rightmenu: enable: false faicon: fa # 公共图标类型 fa fal fa-solid fa-duotone # hr: 分割线, music: 音乐控制器 layout: [home, hr, help, examples, contributors, hr, source_docs, source_theme, hr, print, darkmode, reading, music] ### 可选功能项 ### print: # 只有文章页才允许自定义打印 name: 打印页面 icon: fa fa-print darkmode: # 需开启 plugins.darkmodejs name: 暗黑模式 icon: fa fa-moon reading: name: 阅读模式 icon: fa fa-book-open customPicUrl: # 右键的图片复制:只有 Chrome 支持,且只支持 PNG 格式的图片。 enable: false # 如果使用了对象存储且开启了自适应 Webp,那么可以提供额外的链接用以替换图片的访问地址 old: #https://static.inkss.cn/img/article/ new: #https://cdn.jsdelivr.net/gh/inkss/inkss-cdn@master/img/article/ music: # 当设定全局音乐播放器时,是否一直显示音乐控制菜单。false:仅当音乐播放时启用 alwaysShow: true ### 自定义菜单 ### help: name: 常见问题 icon: fa fa-question url: https://volantis.js.org/faqs/ examples: name: 示例博客 icon: fa fa-rss url: https://volantis.js.org/examples/ contributors: name: 加入社区 icon: fa fa-fan fa-spin url: https://volantis.js.org/contributors/ source_docs: name: 本站源码 icon: fa fa-code-branch url: https://github.com/volantis-x/volantis-docs/ source_theme: name: 主题源码 icon: fa fa-code-branch url: https://github.com/volantis-x/hexo-theme-volantis/ ############################### Rightmenu ############################### > end ############################### Search ############################### > start # To use hexo search, you need to install the following plugins: # npm i hexo-generator-json-content search: enable: true service: hexo # hexo js: ############################### Search ############################### > end ############################### Color Scheme ############################### > start # Accessibility: 背景色和前景色要有足够的对比度 https://web.dev/color-contrast/ # https://ant.design/docs/spec/colors-cn color_scheme: # ------------ # 通用颜色 common: # 主题色 theme: '#3dd9b6' # 链接色 link: '#2092ec' # 按钮色 button: '#44D7B6' # 鼠标放到交互元素上时的色 hover: '#ff5722' # 主题色块内部的文字颜色 inner: '#fff' # 选中区域文字的背景颜色 selection: 'alpha(#2196f3, 0.2)' # ------------ # 亮色主题(默认) light: # 网站背景色 site_bg: '#f4f4f4' # 网站背景上的文字 site_inner: '#fff' # 网站页脚文字 site_footer: '#666' # 卡片背景色 card: '#fff' # 卡片上的普通文字 text: '#444' # 区块和代码块背景色 block: '#f6f6f6' # 代码块高亮时的背景色 codeblock: '#FFF7EA' # 行内代码颜色 inlinecode: '#c74f00' # 文章部分 h1: '#3a3a3a' h2: '#3a3a3a' h3: '#333' h4: '#444' h5: '#555' h6: '#666' p: '#444' # 列表文字 list: '#666' # 列表 hover 时的文字 list_hl: 'mix($color-theme, #000, 80)' # 辅助性文字 meta: '#888' # 版权卡片背景色 copyright_bkg: '#f5f5f5' # ------------ # 暗色主题 # https://www.maijisheji.com/2094.html dark: # 网站最深底色 # Dark Grey 1 site_bd: '#121212' # 网站背景色 # Dark Grey 2 site_bg: '#1f1f1f' # 卡片背景色 # Dark Grey 3 card: '#262626' # 网站背景上的文字 site_inner: '#eeeeeede' # 网站页脚文字 site_footer: '#aaaaaade' # 卡片上的普通文字 text: '#eeeeeede' # 区块和代码块背景色 # Dark Grey 4 block: '#434343' # 代码块高亮时的背景色 # Dark Grey 2 codeblock: '#1f1f1f' # 行内代码颜色 inlinecode: '#D56D28' # 文章部分 高强度文本的不透明度应为87% 中等重点文字适用于60% h1: '#FFFFFFde' # Dark Grey 8 h2: '#FFFFFFde' h3: '#FFFFFF99' # Dark Grey 7 h4: '#FFFFFF99' h5: '#FFFFFF99' h6: '#FFFFFF99' p: '#d9d9d9de' # Dark Grey 6 # 列表文字 # Dark Grey 6 list: '#d9d9d9de' # 列表 hover 时的文字 list_hl: 'mix($color-theme, #fff, 80)' # 辅助性文字 # Dark Grey 5 meta: '#bfbfbfde' # 版权卡片背景色 copyright_bkg: '#21252b' # 夜间图片亮度 brightness: 70% ############################### Color Scheme ############################### > end ############################### Custom css ############################### > start custom_css: cursor: enable: #true text: volantis-static/media/cursor/text.png # https://cdn.jsdelivr.net/gh/inkss/common@1/cursor/text.png pointer: volantis-static/media/cursor/pointer.png # https://cdn.jsdelivr.net/gh/inkss/common@1/cursor/pointer.png default: volantis-static/media/cursor/left_ptr.png # https://cdn.jsdelivr.net/gh/inkss/common@1/cursor/left_ptr.png not-allowed: volantis-static/media/cursor/circle.png # https://cdn.jsdelivr.net/gh/inkss/common@1/cursor/circle.png zoom-out: volantis-static/media/cursor/zoom-out.png # https://cdn.jsdelivr.net/gh/inkss/common@1/cursor/zoom-out.png zoom-in: volantis-static/media/cursor/zoom-in.png # https://cdn.jsdelivr.net/gh/inkss/common@1/cursor/zoom-in.png grab: volantis-static/media/cursor/openhand.png # https://cdn.jsdelivr.net/gh/inkss/common@1/cursor/openhand.png font_smoothing: true # font-smoothing for webkit max_width: 1080px # Sum of body width and sidebar width (This limit will be exceeded when the device width is greater than 2000px, reaching 75% of the total width) scrollbar: size: 4px border: 2px background: rgb(84,181,160) linear-gradient(45deg, rgba(255, 255, 255, 0.4) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.4) 75%, transparent 75%, transparent) hover_background: rgb(84,181,160) linear-gradient(45deg, rgba(255, 255, 255, 0.4) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.4) 75%, transparent 75%, transparent) navbar: height: 64px width: auto # auto, max effect: [shadow, floatable, blur] # [shadow, floatable, blur] sidebar: effect: [shadow, floatable, blur] # [shadow, floatable, blur] body: effect: [shadow, floatable, blur] # [shadow, floatable, blur] highlight: language: true # show language of codeblock grayscale: false # Enable grayscale effect text_align: # left, right, justify, center h1: left h2: left h3: left h4: left p: justify gap: h2: 48px # Spacing above H2 (only px unit) h3: 24px # Spacing above H3 (only px unit) h4: 16px # Spacing above H4 (only px unit) p: 1em # Paragraph spacing between paragraphs line_height: 1.6 # normal, 1.5, 1.75, 2 ... border_radius: card: 8px codeblock: 4px searchbar: 8px button: 4px fontsize: root: 16px h1: 1.5rem # 不推荐用在文章中 h2: 1.5rem h3: 1.25rem h4: 1.125rem h5: 1rem h6: 1rem list: .9375rem meta: .875rem code: .8125rem footnote: .78125rem fontfamily: logofont: fontfamily: '"Varela Round", "PingFang SC", "Microsoft YaHei", Helvetica, Arial' name: 'Varela Round' url: volantis-static/media/fonts/VarelaRound/VarelaRound-Regular.ttf # https://cdn.jsdelivr.net/gh/volantis-x/cdn-fonts/VarelaRound/VarelaRound-Regular.ttf weight: normal style: normal bodyfont: fontfamily: 'UbuntuMono, "Varela Round", "PingFang SC", "Microsoft YaHei", Helvetica, Arial' name: 'UbuntuMono' url: volantis-static/media/fonts/UbuntuMono/UbuntuMono-Regular.ttf # https://cdn.jsdelivr.net/gh/volantis-x/cdn-fonts/UbuntuMono/UbuntuMono-Regular.ttf weight: normal style: normal codefont: fontfamily: 'Menlo, UbuntuMono, Monaco' # name: 'Monaco' # url: volantis-static/media/fonts/Monaco/Monaco.ttf # https://cdn.jsdelivr.net/gh/volantis-x/cdn-fonts/Monaco/Monaco.ttf # weight: normal # style: normal ############################### Custom css ############################### > end ############################### Analytics ############################### > start analytics: busuanzi: #volantis-static/libs/busuanzi/js/busuanzi.pure.mini.js #https://cdn.jsdelivr.net/gh/volantis-x/cdn-busuanzi@2.3/js/busuanzi.pure.mini.js leancloud: # 请使用自己的 id & key 以防止数据丢失 app_id: # u9j57bwJod4EDmXWdxrwuqQT-MdYXbMMI app_key: # jfHtEKVE24j0IVCGHbvuFClp custom_api_server: # 国际版一般不需要写,除非自定义了 API Server ############################### Analytics ############################### > end ############################### SEO ############################### > start seo: # When there are no keywords in the article's front-matter, use tags as keywords. use_tags_as_keywords: true # When there is no description in the article's front-matter, use excerpt as the description. use_excerpt_as_description: true robots: home_first_page: index,follow home_other_pages: noindex,follow archive: noindex,follow category: noindex,follow tag: noindex,follow # robots can be written in front-matter ############################### SEO ############################### > end ############################### Open Graph ############################### > start # https://ogp.me/ # https://hexo.io/zh-cn/docs/helpers#open-graph open_graph: image: volantis-static/media/org.volantis/blog/favicon/android-chrome-192x192.png # https://cdn.jsdelivr.net/gh/volantis-x/cdn-org/blog/favicon/android-chrome-192x192.png twitter_card: summary # summary_large_image , summary #twitter_id: #twitter_site: ############################### Open Graph ############################### > end ############################### Structured Data ############################### > start # SEO 入门文档: https://developers.google.com/search/docs # https://schema.org.cn/ # 结构化数据用于更改搜索结果的显示效果 # 目前内置的结构化数据: blogposting, breadcrumblist, organization, person, website # 目前内置的富媒体搜索结果: 路径(面包屑导航), 徽标(Logo), 站点链接搜索框(SearchAction) # https://developers.google.com/search/docs/advanced/structured-data/intro-structured-data # 富媒体搜索结果测试: https://search.google.com/test/rich-results structured_data: enable: true # 以下是覆盖配置, 默认配置见 scripts/helpers/structured-data/lib/config.js data: person: sns: - https://github.com/volantis-x logo: path: volantis-static/media/org.volantis/blog/favicon/android-chrome-192x192.png # https://cdn.jsdelivr.net/gh/volantis-x/cdn-org/blog/favicon/android-chrome-192x192.png width: 192 height: 192 ############################### Structured Data ############################### > end ```

查看 Demo 完整的 _config.yml

```bash # Hexo Configuration ## Docs: https://hexo.io/docs/configuration.html ## Source: https://github.com/hexojs/hexo/ # Site title: Hexo subtitle: '' description: 'test description' keywords: author: John Doe language: en timezone: '' # URL ## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/' url: http://yoursite.com root: / permalink: :year/:month/:day/:title/ permalink_defaults: pretty_urls: trailing_index: true # Set to false to remove trailing 'index.html' from permalinks trailing_html: true # Set to false to remove trailing '.html' from permalinks # Directory source_dir: source public_dir: public tag_dir: tags archive_dir: archives category_dir: categories code_dir: downloads/code i18n_dir: :lang skip_render: # Writing new_post_name: :title.md # File name of new posts default_layout: post titlecase: false # Transform title into titlecase external_link: enable: true # Open external links in new tab field: site # Apply to the whole site exclude: '' filename_case: 0 render_drafts: false post_asset_folder: false relative_link: false future: true highlight: enable: true line_number: true auto_detect: false tab_replace: '' wrap: true hljs: false prismjs: enable: false preprocess: true line_number: true tab_replace: '' # Home page setting # path: Root path for your blogs index page. (default = '') # per_page: Posts displayed per page. (0 = disable pagination) # order_by: Posts order. (Order by date descending by default) index_generator: path: '' per_page: 10 order_by: -date # Category & Tag default_category: uncategorized category_map: tag_map: # Metadata elements ## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta meta_generator: true # Date / Time format ## Hexo uses Moment.js to parse and display date ## You can customize the date format as defined in ## http://momentjs.com/docs/#/displaying/format/ date_format: YYYY-MM-DD time_format: HH:mm:ss ## updated_option supports 'mtime', 'date', 'empty' updated_option: 'mtime' # Pagination ## Set per_page to 0 to disable pagination per_page: 10 pagination_dir: page # Include / Exclude file(s) ## include:/exclude: options only apply to the 'source/' folder include: exclude: ignore: # Extensions ## Plugins: https://hexo.io/plugins/ ## Themes: https://hexo.io/themes/ theme: volantis # Deployment ## Docs: https://hexo.io/docs/deployment.html deploy: type: '' ```

测试结果

再次跑了 hexo s 之后,就本次反馈的问题,进行了相关复制操作,未能发现不能复制问题

image

右键能正常显示

尝试复制:

image

image

这里使用了 Snipaste 贴图方式显示复制结果,如果没有使用过此程序,可以下载回来复制后按 F3 键体验

打开控制台,留意相关信息 image

再进行多次复制,控制台不会新增错误,复制的结果也是正确,本次测试结束

image

image

image

image

问题发生的原因猜测

看 volantis 主题的配置文件,是有两处右键菜单的配置,目前我只修改了 的右键菜单,对于 的右键菜单是关闭未使用的,不知您的这个问题情况,是否因为 的打开导致的呢?

我尝试过新旧一起打开使用,会出现严重错误,导致右键菜单不会生效:

image

而您的情况是能生效的,故,没办法再进一步测试。

本次测试到此结束,希望能给您带来帮助。

Tikas commented 11 months ago

可以尝试本地跑一次官方 demo ,如果还是会出错,看了其他相关,也只有 nodejs 版本不同,可以尝试使用 nodejs: 18.16.0 试试

inkss commented 11 months ago

您好,请在能复现该问题的环境中打开控制台,输入如下内容:

volantis.GLOBAL_CONFIG.debug = "rightMenus"

然后触发右键复制流程,观察控制台错误输出,并回复在本条目中。

github-actions[bot] commented 11 months ago

:wave: Hello, Are you still there? We are waiting for your response. If you do not reply, we will close this issue.

:wave: 您好, 还在吗?我们正等待您的回应,如果您迟迟没有回复,我们将会关闭这个 issue 。