Skip to content

Commit 4f66dd3

Browse files
committed
add post
1 parent 4b6b05d commit 4f66dd3

File tree

6 files changed

+113
-8
lines changed

6 files changed

+113
-8
lines changed

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ gem "wdm", "~> 0.1", :platforms => [:mingw, :x64_mingw, :mswin]
3434
# do not have a Java counterpart.
3535
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]
3636

37-
# gem "jekyll-github-metadata"
37+
gem "jekyll-github-metadata"
3838

39-
# gem "jekyll-compose", group: [:jekyll_plugins]
39+
gem "jekyll-compose", group: [:jekyll_plugins]

_config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ description: >
1717
# As of November 2023, GitHub Pages still uses Minima 2.5.1 (https://pages.github.com/versions/).
1818
# If you want to use the latest Minima version on GitHub Pages, use the following setting and
1919
# add a line comment on "theme: minima" above.
20-
remote_theme: jekyll/minima
20+
remote_theme: jekyll/minima@v2.5.2
2121

2222
plugins:
2323
- jekyll-feed
2424
- jekyll-seo-tag
25-
# - jekyll-github-metadata
25+
- jekyll-github-metadata
2626
# Minima specific settings, which are only available from Minima 3.0 onward.
2727
minima:
2828
# Minima skin selection.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
layout: post
3+
title: 使用jekyll构建GitHub Pages站点过程总结
4+
date: 2025-03-28 17:17 +0800
5+
---
6+
7+
打开github官方文档,映入眼帘的是海量的工具,软件,教程,让人眼花缭乱。
8+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
layout: post
3+
title: 神奇的斐波拉契数列
4+
date: 2025-03-28 17:52 +0800
5+
---
6+
7+
斐波拉契数列是一个非常神奇的数列,它的定义如下:
8+
F0 = 0, F1 = 1, Fn = Fn-1 + Fn-2 (n >= 2)
9+
我们可以写出它的前几项:
10+
0, 1, 1, 2, 3, 5, 8, 13...

index.html

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
# front matter tells Jekyll to process Liquid
3+
layout: page
4+
---
5+
<div class="home">
6+
<!-- <h1>{{ site.title }}</h1>
7+
<p>{{ site.description }}</p> -->
8+
9+
<div class="navigation">
10+
<h2>快速导航</h2>
11+
<ul>
12+
<li><a href="/blog/">所有文章</a></li>
13+
<li><a href="/about/">关于我</a></li>
14+
</ul>
15+
</div>
16+
17+
<div class="featured-posts">
18+
<h2>推荐文章</h2>
19+
<ul>
20+
{% for post in site.posts limit:3 %}
21+
<li>
22+
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
23+
<span class="post-date">{{ post.date | date: "%Y-%m-%d" }}</span>
24+
</li>
25+
{% endfor %}
26+
</ul>
27+
</div>
28+
</div>
29+

index.markdown

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,64 @@
11
---
2-
# Feel free to add content and custom Front Matter to this file.
3-
# To modify the layout, see https://jekyllrb.com/docs/themes/#overriding-theme-defaults
4-
5-
layout: home
2+
layout: page
3+
title: 所有文章
4+
permalink: /blog/
65
---
6+
7+
<div class="post-list">
8+
{% for post in site.posts %}
9+
<div class="post-item">
10+
<h2>
11+
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
12+
</h2>
13+
<div class="post-meta">
14+
<span class="post-date">发布日期: {{ post.date | date: "%Y-%m-%d" }}</span>
15+
16+
{% if post.categories.size > 0 %}
17+
<span class="post-categories">
18+
分类:
19+
{% for category in post.categories %}
20+
<a href="/categories/#{{ category | slugize }}">{{ category }}</a>{% unless forloop.last %}, {% endunless %}
21+
{% endfor %}
22+
</span>
23+
{% endif %}
24+
25+
{% if post.tags.size > 0 %}
26+
<span class="post-tags">
27+
标签:
28+
{% for tag in post.tags %}
29+
<a href="/tags/#{{ tag | slugize }}">{{ tag }}</a>{% unless forloop.last %}, {% endunless %}
30+
{% endfor %}
31+
</span>
32+
{% endif %}
33+
</div>
34+
35+
{% if post.description %}
36+
<p class="post-description">{{ post.description }}</p>
37+
{% else %}
38+
<p class="post-excerpt">{{ post.excerpt | strip_html | truncatewords: 30 }}</p>
39+
{% endif %}
40+
41+
<a href="{{ post.url | relative_url }}" class="read-more">阅读全文 &raquo;</a>
42+
</div>
43+
{% endfor %}
44+
</div>
45+
46+
<style>
47+
.post-item {
48+
margin-bottom: 2rem;
49+
padding-bottom: 1rem;
50+
border-bottom: 1px solid #eee;
51+
}
52+
.post-meta {
53+
color: #666;
54+
font-size: 0.9rem;
55+
margin-bottom: 0.5rem;
56+
}
57+
.post-meta span {
58+
margin-right: 1rem;
59+
}
60+
.read-more {
61+
display: inline-block;
62+
margin-top: 0.5rem;
63+
}
64+
</style>

0 commit comments

Comments
 (0)