在这个信息爆炸的时代,我们需要一个简单纯粹的写作空间。Looks Blog 让你专注于内容创作,而不是复杂的技术配置。
核心理念
点击 Use this template 按钮,GitHub 会为你创建一个全新的博客仓库。
打开 config.json 文件,这是你博客的"身份证",让我们一起填写:
{
"site": {
"title": "张三的技术博客",
"description": "分享前端开发经验与生活感悟",
"url": "https://zhangsan.github.io/my-blog",
"author": "zhangsan",
"avatar": "https://github.com/zhangsan.png",
"favicon": "https://github.com/zhangsan.png",
"language": "zh-CN",
"date": "2024-01-01"
},
"github": {
"owner": "zhangsan",
"repo": "my-blog"
}
}
参数详解:
site 部分 - 博客基本信息
title - 博客标题,会显示在网站顶部和浏览器标签页description - 博客描述,用于 SEO 和社交分享url - 博客访问地址
username.github.io,填写:https://username.github.iohttps://username.github.io/仓库名author - 你的 GitHub 用户名,用于版权信息和链接avatar - 头像图片链接,建议使用 GitHub 头像:https://github.com/用户名.pngfavicon - 网站图标链接,显示在浏览器标签页和书签中language - 网站语言,影响页面的语言标识date - 博客创建日期,用于计算运行天数github 部分 - GitHub 仓库信息
owner - GitHub 用户名(与 author 保持一致)repo - 仓库名称imageProxy 部分 - 图片代理配置
enabled - 是否启用图片代理(true/false)baseUrl - 代理服务地址,默认使用 weserv.nldescription - 功能说明comments 部分 - 评论系统配置
enabled - 是否启用评论功能(true/false)provider - 评论系统提供商,可选值:giscus、utterances、gitalk、nonegiscus - Giscus 评论系统配置(推荐)utterances - Utterances 评论系统配置gitalk - GitTalk 评论系统配置重要提醒:
请确保
owner和repo与你的实际仓库信息一致,否则无法正确获取 Issues 数据
这一步让你的博客真正"上线":
小贴士:
现在来体验最有趣的部分 - 写作!
恭喜! 你的博客已经搭建完成,文章会在几分钟内自动发布到你的网站。
标题的艺术
内容结构建议
#、##、###)组织内容分类标签策略
文章管理功能
pinned 或 置顶 标签,文章会显示在首页顶部并带有 📌 图标支持的 Markdown 语法
代码- [ ] 和 - [x]图片处理功能
config.json 中开启/关闭图片代理功能图片使用建议
Looks Blog 支持三种主流的评论系统,你可以根据需要选择其中一种:
Giscus 是基于 GitHub Discussions 的评论系统,功能强大且现代化。
配置步骤:
启用 GitHub Discussions
获取配置信息
username/blog-repo)pathname)General)更新 config.json
{
"comments": {
"enabled": true,
"provider": "giscus",
"giscus": {
"repo": "username/blog-repo",
"repoId": "R_kgDOH...",
"category": "General",
"categoryId": "DIC_kwDOH...",
"mapping": "pathname",
"strict": "0",
"reactionsEnabled": "1",
"emitMetadata": "0",
"inputPosition": "bottom",
"theme": "preferred_color_scheme",
"lang": "zh-CN"
}
}
}
Utterances 是基于 GitHub Issues 的轻量级评论系统。
配置步骤:
安装 Utterances App
更新 config.json
{
"comments": {
"enabled": true,
"provider": "utterances",
"utterances": {
"repo": "username/blog-repo",
"issueTerm": "pathname",
"label": "comment",
"theme": "github-light"
}
}
}
GitTalk 是功能丰富的评论系统,需要创建 GitHub OAuth App。
配置步骤:
创建 GitHub OAuth App
你的博客名称 Commentshttps://username.github.io/blog-repohttps://username.github.io/blog-repo更新 config.json
{
"comments": {
"enabled": true,
"provider": "gitalk",
"gitalk": {
"clientID": "your-client-id",
"clientSecret": "your-client-secret",
"repo": "blog-repo",
"owner": "username",
"admin": ["username"],
"id": "pathname",
"distractionFreeMode": false,
"language": "zh-CN"
}
}
}
如果不需要评论功能,可以完全禁用:
{
"comments": {
"enabled": false,
"provider": "none"
}
}
评论系统对比:
| 特性 | Giscus | Utterances | GitTalk |
|---|---|---|---|
| 基于 | GitHub Discussions | Git |
Test
https://github.com/mature-chives/mature-chives.github.io/issues/3
Labels: good first issue
No CONTRIBUTING document was found. Please check the README and open issues.