File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# 基本配置
22title : " TY的博客"
33description : " 分享编程和生活"
4+ logo : /assets/img/MiLogal.jpg
5+ show_downloads : true
46baseurl : " " # 如果部署在子路径,填写子路径
57url : " https://tyuecode.github.io"
68
Original file line number Diff line number Diff line change 11---
22layout: default
33---
4-
5- < small > {{ page.date | date: "%-d %B %Y" }}</ small >
64< h1 > {{ page.title }}</ h1 >
75
86< p class ="view "> by {{ page.author | default: site.author }}</ p >
9-
10- {{content}}
11-
12- {% if page.tags %}
13- < small > tags: < em > {{ page.tags | join: "</ em > - < em > " }}</ em > </ small >
14- {% endif %}
7+ < small > {{ page.date | date: "%-d %B %Y" }}</ small >
Original file line number Diff line number Diff line change 1+ ---
2+ layout : post
3+ title : " Jekyll+GitHub Pages搭建指南"
4+ date : 2026-02-02 10:00:00 +0800
5+ categories : [博客教程] # 精准分类(两级)
6+ tags : [github, jekyll, 静态博客] # 细分标签
7+ excerpt : " 本文详细讲解从0到1搭建Jekyll+GitHub Pages博客,包括配置、部署、个性化全流程。" # 自定义摘要
8+ ---
9+
10+ 这是我的第一篇博客,记录基于Jekyll+GitHub Pages搭建个人博客的全过程。
11+
12+ <!-- more--> <!-- 摘要分隔符,前面内容会作为首页摘要 -->
13+
14+ ## 一、为什么选Jekyll+GitHub Pages?
15+ GitHub Pages是GitHub 官方提供的免费静态网站托管服务,让你能直接从 GitHub 仓库创建和发布网站,无需配置复杂服务器或支付托管费用。
16+
17+ Jekyll是一个静态网站生成器,它可以直接在GitHub Pages上构建,让你只需编写上传Markdown文件就能完成博客网站的更新。
18+
19+ - 免费:GitHub Pages提供免费静态托管,无服务器成本;
20+ - 轻量:无数据库,静态页面加载快;
21+ - 易维护:Markdown写文章,Git版本控制,Jekyll生成静态网站。
22+
23+ ## 二、核心步骤
24+ 1 . 创建GitHub仓库(命名:用户名.github.io);
25+ 2 . 进入仓库Settings界面的Pages选项中;
26+ 3 . 将Build and deployment的Source选择为GitHub Actions;
27+ 4 . 选择使用Jekyll,通过GitHub Actions自动部署;
28+ 5 . 配置Jekyll核心文件(_ config.yml、_ posts等);
29+ [ 可参考本站源码] ( https://github.com/tyuecode/tyuecode.github.io )
30+
31+ GitHub Pages默认使用Jekyll,所以当你推送Jekyll网站的文件到仓库时,它会自动构建并更新网站内容
32+ ## 三、拓展功能
33+ - 更换换主题:[ pages-themes] ( https://github.com/pages-themes ) 中收录了可直接使用的主题
34+ - 编辑_config.yml以修改网站配置
35+ - 编辑index.md以修改首页内容
36+ - 编辑about.md以修改关于页面
37+ - 在_posts目录中添加新文章
38+ - 在_layouts目录中更改页面布局
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments