Skip to content

Commit 306c27f

Browse files
committed
blog: fix config/layout/issues (README.md)
1 parent a3951c9 commit 306c27f

1 file changed

Lines changed: 49 additions & 12 deletions

File tree

‎README.md‎

Lines changed: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,55 @@
1-
# Jekyll Minimal 主题网站
1+
# TY的博客(tyuecode.github.io)
22

3-
这是一个基于 Jekyll Minimal 主题的 GitHub Pages 网站。
3+
基于 Jekyll(`jekyll-theme-minimal` 主题)的静态博客,通过 GitHub Actions 自动构建并部署到 GitHub Pages,正式域名为 **https://tangyue.me**。
44

5+
## 目录结构
56

6-
## 部署到 GitHub Pages
7+
```
8+
_config.yml # 站点配置(标题/作者/主题/插件/SEO/评论/分页)
9+
_layouts/
10+
default.html # 基础布局(head/header/section/footer)
11+
post.html # 文章布局(继承 default,含评论区)
12+
_includes/
13+
head-custom.html # 自定义 <head>(favicon 等)
14+
_posts/ # 博客文章(文件名格式 YYYY-MM-DD-slug.md)
15+
index.md # 首页(文章列表 + 分页)
16+
about.md # 关于页
17+
tags.md # 标签归档页
18+
404.md # 404 页面
19+
assets/img/MiLogo.jpg # 站点 logo / favicon
20+
Gemfile # 构建依赖(github-pages gem 栈)
21+
.github/workflows/jekyll-gh-pages.yml # CI/CD:push main 自动构建部署
22+
```
723

8-
1. 将本仓库推送到 GitHub
9-
2. 在仓库设置中启用 GitHub Pages
10-
3. 选择 main 分支作为源
11-
4. 网站将 `https://username.github.io` 上线
24+
## 本地预览
1225

13-
## 自定义
26+
```bash
27+
bundle install
28+
bundle exec jekyll serve
29+
# 打开 http://localhost:4000
30+
```
1431

15-
- 编辑 `_config.yml` 修改网站配置
16-
- 编辑 `index.md` 修改首页内容
17-
- 编辑 `about.md` 修改关于页面
18-
- 在 `_posts` 目录中添加新文章
32+
## 发布新文章
33+
34+
1. 在 `_posts/` 下新建文件,命名为 `YYYY-MM-DD-标题英文slug.md`;
35+
2. 顶部加上 front matter:
36+
```yaml
37+
---
38+
layout: post
39+
title: "文章标题"
40+
date: YYYY-MM-DD
41+
categories: [分类]
42+
tags: [标签1, 标签2]
43+
excerpt: "一句话摘要"
44+
---
45+
```
46+
3. 正文用 `<!--more-->` 分隔摘要与正文;
47+
4. 推送到 `main` 分支,GitHub Actions 会自动重新部署(通常 1–2 分钟生效)。
48+
49+
## 功能
50+
51+
- RSS 订阅:`/feed.xml`
52+
- 站点地图:`/sitemap.xml`
53+
- SEO:`jekyll-seo-tag` 自动生成 canonical / Open Graph / Twitter 卡片
54+
- 评论:Utterances(基于 GitHub Issues,需在仓库安装 Utterances 应用)
55+
- 分页:`jekyll-paginate`,每页 5 篇

0 commit comments

Comments
 (0)