Hexo Giscus 评论 (NexT 主题)

详情请参考官方网站 Giscus 官方网站 1 https://giscus.app/zh-CN Hexo-next-giscus 官方仓库 1 https://github.com/next-theme/hexo-next-giscus 参考的博客,不保证链接长期有效 1 https://getiot.tech/knowledge-base/hexo/hexo-comments 看域名,这个有可能在大陆被 ban 掉,科学上网 1 https://ithelp.ithome.com.tw/articles/10306883 自己实践过的步骤 准备工作 你的仓库必须是公开的 (public),否则访客将无法查看 discussion 你的 GitHub 已安装 giscus app ,否则访客将无法评论和回应 在你的仓库中启用 Discussions 功能 Hexo 配置 在你的 Hexo 博客目录中执行以下命令,安装 hexo-next-giscus 插件 1 npm install hexo-next-giscus --save 然后在 Hexo 或者 theme 的 _config.yml (我的是 _config.next.yml) 配置文件添加如下内容 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 giscus: enable: false repo: # Github repository name repo_id: # Github repository id category: # Github discussion category category_id: # Github discussion category id # Available values: pathname | url | title | og:title mapping: pathname # Available values: 0 | 1 reactions_enabled: 1 # Available values: 0 | 1 emit_metadata: 1 # Available values: light | dark | dark_high_contrast | transparent_dark | preferred-color-scheme theme: light # Available values: en | zh-CN lang: en # Place the comment box above the comments input_position: bottom # Load the comments lazily loading: lazy Giscus 配置...

二月 12, 2023 · 1 分钟 · 193 字 · HCY

Hexo 添加友情链接

给友链新增一个单独的页面 命令创建页面 1 hexo new page links 也可在博客根目录 /source 下手动创建 links 文件夹和里边的 index.md 文件 然后在博客根目录 /source 下会生成一个 links 文件夹,打开其中的 index.md 文件,在头部写入 type = “links”,这个一定要写 1 2 3 4 5 --- title: 友情链接 date: 2019-12-08 03:21:39 type: "links" --- 主题配置文件中menu下添加(我的是 NEXT 主题) 1 Links: /links/ || fa fa-link 在 /themes/next/languages/zh-Hans.yml 文件中 menu 下增加中文描述(可选) 1 links: 友链 像普通的 markdown 那样子编辑 index.md 就可以了

二月 12, 2023 · 1 分钟 · 60 字 · HCY

Hexo 代码块配置

在 NexT 的主题配置文件里面启用 ...

二月 11, 2023 · 1 分钟 · 56 字 · HCY

Hexo首页只显示部分摘要

本文针对Next主题,不确保对于其它主题有效(但从修改模式来看,是有效的) 修改配置 首先需要在Next主题的_config.yml中把设置打开:(默认安装时就打开了) 1 2 # Automatically excerpt description in homepage as preamble text. excerpt_description: true 方法一:写概述 在文章的front-matter中添加description,其中description中的内容就会被显示在首页上,其余一律不显示 1 2 3 4 5 --- title: 让首页显示部分内容 date: 2020-02-23 22:55:10 description: 这是显示在首页的概述,正文内容均会被隐藏。 --- 方法二:文章截断 在需要截断的地方加入 首页就会显示这条以上的所有内容,隐藏接下来的所有内容

二月 11, 2023 · 1 分钟 · 35 字 · HCY

Hexo next favicon

把图标放在 hexo\source\images 目录下,这个目录没有可以自己手动创建 修改 next主题配置文件,\next\themes\next_config.yml 文件 1 2 3 4 5 6 7 8 favicon: small: /images/favicon-16x16-next.png #medium: /images/favicon-32x32-next.png medium: /images/favicon.ico apple_touch_icon: /images/apple-touch-icon-next.png safari_pinned_tab: /images/logo.svg #android_manifest: /images/manifest.json #ms_browserconfig: /images/browserconfig.xml

二月 11, 2023 · 1 分钟 · 29 字 · HCY