Posts
Blogging is baked into Jekyll. You write blog posts as text files and Jekyll provides everything you need to turn it into a blog.
The Posts FolderPermalink
The _posts folder is where your blog posts live. You typically write posts in Markdown, HTML is also supported.
Creating PostsPermalink
To create a post, add a file to your _posts directory with the following format:
YEAR-MONTH-DAY-title.MARKUP
Where YEAR is a four-digit number, MONTH and DAY are both two-digit numbers, and MARKUP is the file extension representing the format used in the file. For example, the following are examples of valid post filenames:
2011-12-31-new-years-eve-is-awesome.md
2012-09-12-how-to-write-a-blog.md
All blog post files must begin with front matter which is typically used to set a layout or other meta data. For a simple example this can just be empty:
---
layout: post
title: "Welcome to Jekyll!"
---
# Welcome
**Hello world**, this is my first Jekyll blog post.
I hope you like it!
ProTip™: Link to other posts
Use the post_url tag to link to other posts without having to worry about the URLs breaking when the site permalink style changes.
Be aware of character sets
Content processors can modify certain characters to make them look nicer. For example, the smart extension in Redcarpet converts standard, ASCII quotation characters to curly, Unicode ones. In order for the browser to display those characters properly, define the charset meta value by including <meta charset="utf-8"> in the <head> of your layout.
Including images and resourcesPermalink
At some point, you’ll want to include images, downloads, or other digital assets along with your text content. One common solution is to create a folder in the root of the project directory called something like assets, into which any images, files or other resources are placed. Then, from within any post, they can be linked to using the site’s root as the path for the asset to include. The best way to do this depends on the way your site’s (sub)domain and path are configured, but here are some simple examples in Markdown:
Including an image asset in a post:
... which is shown in the screenshot below:

Linking to a PDF for readers to download:
... you can [get the PDF](/assets/mydoc.pdf) directly.
Displaying an index of postsPermalink
Creating an index of posts on another page should be easy thanks to Liquidand its tags. Here’s a simple example of how to create a list of links to your blog posts:
<ul>
<li>
<a href="/How-to-Tric-Your-Brain-into-Doing-Difficult-Things">如何欺骗你的大脑去完成困难的事情</a>
</li>
<li>
<a href="/TypeScript-Introduce">TypeScript Introduce</a>
</li>
<li>
<a href="/go-stander">go 代码规范</a>
</li>
<li>
<a href="/v2ray-proxy">v2ray 安装使用</a>
</li>
<li>
<a href="/codebuddy-prompt">codebuddy-prompt</a>
</li>
<li>
<a href="/endlesschen-leetcode">灵茶山艾府-基础算法笔记</a>
</li>
<li>
<a href="/golang-heap">golang-heap</a>
</li>
<li>
<a href="/golang-gmp">golang-gmp模型</a>
</li>
<li>
<a href="/gh-ost">gh-ost 源码阅读</a>
</li>
<li>
<a href="/gogc">go gc</a>
</li>
<li>
<a href="/golang-package-sort">golang package sort</a>
</li>
<li>
<a href="/go-exec">exec.Command 与 os.StartProcess 有什么不一样</a>
</li>
<li>
<a href="/go-pprof">Go 性能调优</a>
</li>
<li>
<a href="/go-iter">Go 1.23 iter 学习</a>
</li>
<li>
<a href="/trpc-go">tRPC-GO</a>
</li>
<li>
<a href="/storage">存储</a>
</li>
<li>
<a href="/distribute-vs-cloud-native">分布式数据库和云原生数据库</a>
</li>
<li>
<a href="/DDD">DDD</a>
</li>
<li>
<a href="/go-databases-sql">Golang database/sql 数据库连接源码阅读</a>
</li>
<li>
<a href="/raft">raft</a>
</li>
<li>
<a href="/pt-osc">pt-osc 执行流程</a>
</li>
<li>
<a href="/hello">Welcome to Jekyll!</a>
</li>
</ul>
You have full control over how (and where) you display your posts, and how you structure your site. You should read more about how templates workwith Jekyll if you want to know more.
Note that the post variable only exists inside the for loop above. If you wish to access the currently-rendering page/posts’s variables (the variables of the post/page that has the for loop in it), use the pagevariable instead.
Tags and CategoriesPermalink
Jekyll has first class support for tags and categories in blog posts.
TagsPermalink
Tags for a post are defined in the post’s front matter using either the keytag for a single entry or tags for multiple entries.
Since Jekyll expects multiple items mapped to the key tags, it will automatically split a string entry if it contains whitespace. For example, while front matter tag: classic hollywood will be processed into a singular entity "classic hollywood", front matter tags: classic hollywood will be processed into an array of entries ["classic", "hollywood"].
Irrespective of the front matter key chosen, Jekyll stores the metadata mapped to the plural key which is exposed to Liquid templates.
All tags registered in the current site are exposed to Liquid templates viasite.tags. Iterating over site.tags on a page will yield another array with two items, where the first item is the name of the tag and the second item being an array of posts with that tag.
CategoriesPermalink
Categories of a post work similar to the tags above:
- They can be defined via the front matter using keys
categoryorcategories(that follow the same logic as for tags) - All categories registered in the site are exposed to Liquid templates via
site.categorieswhich can be iterated over (similar to the loop for tags above.)
The similarity between categories and tags however, ends there.
Unlike tags, categories for posts can also be defined by a post’s file path. Any directory above _posts will be read-in as a category. For example, if a post is at path movies/horror/_posts/2019-05-21-bride-of-chucky.markdown, then movies and horror are automatically registered as categories for that post.
When the post also has front matter defining categories, they just get added to the existing list if not present already.
The hallmark difference between categories and tags is that categories of a post may be incorporated into the generated URL for the post, while tags cannot be.
Therefore, depending on whether front matter has category: classic hollywood, or categories: classic hollywood, the example post above would have the URL as eithermovies/horror/classic%20hollywood/2019/05/21/bride-of-chucky.htmlor movies/horror/classic/hollywood/2019/05/21/bride-of-chucky.htmlrespectively.
Post excerptsPermalink
You can access a snippet of a posts’s content by using excerpt variable on a post. By default this is the first paragraph of content in the post, however it can be customized by setting a excerpt_separator variable in front matter or _config.yml.
---
excerpt_separator: <!--more-->
---
Excerpt with multiple paragraphs
Here's another paragraph in the excerpt.
<!--more-->
Out-of-excerpt
Here’s an example of outputting a list of blog posts with an excerpt:
<ul>
<li>
<a href="/How-to-Tric-Your-Brain-into-Doing-Difficult-Things">如何欺骗你的大脑去完成困难的事情</a>
<p>translate https://x.com/DrDominicNg/status/2008195481793372661?s=20</p>
</li>
<li>
<a href="/TypeScript-Introduce">TypeScript Introduce</a>
<p><a href="https://www.typescriptlang.org/docs/handbook/intro.html">typescript org</a></p>
</li>
<li>
<a href="/go-stander">go 代码规范</a>
<h1 id="golang-代码规范---tencent-golang-代码规范">Golang 代码规范 - Tencent golang 代码规范</h1>
</li>
<li>
<a href="/v2ray-proxy">v2ray 安装使用</a>
<p>使用官方脚本下载安装</p>
</li>
<li>
<a href="/codebuddy-prompt">codebuddy-prompt</a>
<h1 id="角色定义">角色定义:</h1>
<p>你是 CodeBuddy,一位高级软件工程师,精通多种编程语言、框架、设计模式和最佳实践。</p>
</li>
<li>
<a href="/endlesschen-leetcode">灵茶山艾府-基础算法笔记</a>
<h1 id="零内容">零、内容</h1>
<p>https://github.com/EndlessCheng/codeforces-go/blob/master/leetcode/README.md</p>
</li>
<li>
<a href="/golang-heap">golang-heap</a>
<div class="language-go highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">// The Interface type describes the requirements</span>
<span class="c">// for a type using the routines in this package.</span>
<span class="c">// Any type that implements it may be used as a</span>
<span class="c">// min-heap with the following invariants (established after</span>
<span class="c">// [Init] has been called or if the data is empty or sorted):</span>
<span class="c">//</span>
<span class="c">// !h.Less(j, i) for 0 <= i < h.Len() and 2*i+1 <= j <= 2*i+2 and j < h.Len()</span>
<span class="c">//</span>
<span class="c">// Note that [Push] and [Pop] in this interface are for package heap's</span>
<span class="c">// implementation to call. To add and remove things from the heap,</span>
<span class="c">// use [heap.Push] and [heap.Pop].</span>
<span class="k">type</span> <span class="n">Interface</span> <span class="k">interface</span> <span class="p">{</span>
<span class="n">sort</span><span class="o">.</span><span class="n">Interface</span>
<span class="n">Push</span><span class="p">(</span><span class="n">x</span> <span class="n">any</span><span class="p">)</span> <span class="c">// add x as element Len()</span>
<span class="n">Pop</span><span class="p">()</span> <span class="n">any</span> <span class="c">// remove and return element Len() - 1.</span>
<span class="p">}</span>
</code></pre></div></div>
</li>
<li>
<a href="/golang-gmp">golang-gmp模型</a>
<h3 id="g-m-p-模型">G M P 模型</h3>
</li>
<li>
<a href="/gh-ost">gh-ost 源码阅读</a>
<p>地址:</p>
<ul>
<li>https://github.com/github/gh-ost/tree/master/go</li>
<li>https://deepwiki.com/github/gh-ost</li>
</ul>
</li>
<li>
<a href="/gogc">go gc</a>
<h2 id="1-什么是gc">1. 什么是GC</h2>
<p><code class="language-plaintext highlighter-rouge">GC</code>,全称 <code class="language-plaintext highlighter-rouge">Garbage Collection</code>,即垃圾回收,是一种自动内存管理的机制。</p>
</li>
<li>
<a href="/golang-package-sort">golang package sort</a>
<p>https://www.notion.so/sort-23f21f3fbf218042a172fcee79ac3d8b?source=copy_link</p>
</li>
<li>
<a href="/go-exec">exec.Command 与 os.StartProcess 有什么不一样</a>
<p>exec.Command 与 os.StartProcess 有什么不一样</p>
</li>
<li>
<a href="/go-pprof">Go 性能调优</a>
<p><a href="https://www.liwenzhou.com/posts/Go/pprof/">https://www.liwenzhou.com/posts/Go/pprof/</a></p>
</li>
<li>
<a href="/go-iter">Go 1.23 iter 学习</a>
<p>(https://mp.weixin.qq.com/s?biz=MzA4ODg0NDkzOA==&mid=2247510020&idx=1&sn=c4daaaf3e895bf17a76e2481a74bf243&chksm=91a791e540e5ee433099f24654eaf06126750dd2392d660bf9144cbf33582e4e0022a6f060f9#rd)</p>
</li>
<li>
<a href="/trpc-go">tRPC-GO</a>
<h1 id="trpc-go"><strong>tRPC-go</strong></h1>
</li>
<li>
<a href="/storage">存储</a>
<p><img src="assets/img/Pasted%20image%2020250803125914.png" alt="" />
文件存储 Network-Attached Storage(NAS)
块存储 Direct-Attached Storage(DAS)和 Storage Area Networks(SAN)
对象存储 Object-based Storage
<img src="assets/img/Pasted%20image%2020250803125728.png" alt="" /></p>
</li>
<li>
<a href="/distribute-vs-cloud-native">分布式数据库和云原生数据库</a>
<p>分布式数据库和云原生数据库有一定的关联,但二者的关注点和设计理念不同。可以从 <strong>概念、关系、区别</strong> 三个角度来看:</p>
</li>
<li>
<a href="/DDD">DDD</a>
<p><strong>限界上下文之间的映射关系</strong></p>
</li>
<li>
<a href="/go-databases-sql">Golang database/sql 数据库连接源码阅读</a>
<h1 id="golang-databasesql-数据库连接源码阅读">Golang database/sql 数据库连接源码阅读</h1>
<p>代码仓库 database/sql</p>
</li>
<li>
<a href="/raft">raft</a>
<h1 id="分布式系统下的一致性问题">分布式系统下的一致性问题</h1>
</li>
<li>
<a href="/pt-osc">pt-osc 执行流程</a>
<p>地址 https://github.com/percona/percona-toolkit/tree/3.x/bin
<a href="https://docs.percona.com/percona-toolkit/pt-online-schema-change.html">使用文档</a></p>
</li>
<li>
<a href="/hello">Welcome to Jekyll!</a>
<p><a href="https://jekyllrb.com/">jekyll</a> (<a href="https://orderedlist.com/minimal/">Theme</a>) + <a href="https://pages.github.com/">Github Page</a></p>
</li>
</ul>
DraftsPermalink
Drafts are posts without a date in the filename. They’re posts you’re still working on and don’t want to publish yet. To get up and running with drafts, create a _drafts folder in your site’s root and create your first draft:
.
├── _drafts
│ └── a-draft-post.md
...
To preview your site with drafts, run jekyll serve or jekyll build with the --drafts switch. Each will be assigned the value modification time of the draft file for its date, and thus you will see currently edited drafts as the latest posts.