Hi there 👋

Welcome to my blog

使用 giscus 给博客添加评论功能

Giscus 简介 giscus 是由 GitHub Discussions 驱动的评论系统,全部评论数据储存在 GitHub Discussions 中,一篇博客关联一个 discussion。除了支持评论还支持关联 Discussion 帖子上的表情回复 (reaction) 。 配置 giscus 按照 giscus 官方文档 配置章节的说明,安装 giscus app 并在为所使用的 GitHub 仓库开启 Discussions 功能。 完成映射关系和特性配置后,获得启用 giscus 的代码。 <script src="https://giscus.app/client.js" data-repo="Ljhero/ljhero.github.com" data-repo-id="MDEwOlJlcG9zaXRvcnkzNDQxNjk4" data-category="Comments" data-category-id="DIC_kwDOADSEIs4CO5XI" data-mapping="pathname" data-reactions-enabled="1" data-emit-metadata="0" data-input-position="top" data-theme="light" data-lang="zh-CN" data-loading="lazy" crossorigin="anonymous" async> </script> 配置 Hugo 博客仓库根目录下创建 layouts/partials/comments.html 文件,文件中添加上一步获取到的 giscus 启用代码。 最后修改 config.yml 启用 comments params: comments: true 参考资料 giscus 官方文档 PaperMod 主题 Comments 设置 胡涂说的文章给博客换了套新评论系统

使用 Hugo 和 GitHub Pages 搭建个人博客

本文记录使用 Hugo 和 GitHub Pages搭建个人博客过程 。 安装 Hugo Hugo 1是 Go 语言开发且开源的静态站点生成工具。 参考官方的 Quick Start教程进行安装和使用。 brew install hugo # 查看安装后的版本 ❯ hugo version hugo v0.98.0+extended darwin/arm64 BuildDate=unknown 新建博客代码目录 hugo new site ljhero.github.io -f yml # 初始化 git init 配置主题 下载安装 PaperMod 主题,通过 git submodule 的形式添加到 themes 目录。 git submodule add --depth=1 \ https://github.com/adityatelange/hugo-PaperMod.git themes/PaperMod git submodule update --init --recursive # update theme git submodule update --remote --merge 修改 config.yml 添加主题配置...