This guide provides comprehensive instructions for writing, structuring, and styling content for the Chirpy theme.
_posts/YYYY-MM-DD-TITLE.md (or .markdown)This is the essential metadata at the top of each post file.
1
2
3
4
5
6
---
title: TITLE
date: YYYY-MM-DD HH:MM:SS +/-TTTT
categories: [TOP_CATEGORY, SUB_CATEGORY]
tags: [TAG] # TAG names should always be lowercase
---
layout is post by default and does not need to be specified.date requires a timezone offset (e.g., +0800).1
2
3
4
---
categories: [Blogging, Tutorial]
tags: [writing, jekyll]
---
Author info is pulled from _config.yml by default. To override or add multiple authors:
_data/authors.yml:
1
2
3
4
5
# _data/authors.yml
cotes:
name: Cotes Chung
twitter: cotes2020
url: https://github.com/cotes2020/
1
2
3
4
5
---
author: cotes # for a single author
# or
authors: [cotes, another_author] # for multiple authors
---
A custom summary for the post can be provided. This will be used on the home page, in “Further Reading” sections, and for SEO.
1
2
3
---
description: A short summary of the post that will appear under the title.
---
To pin a post to the top of the home page, add pin: true.
1
2
3
---
pin: true
---
The TOC is enabled by default. To disable it for a specific post:
1
2
3
---
toc: false
---
Comments are enabled globally in _config.yml. To disable them for a specific post:
1
2
3
---
comments: false
---
This section outlines the styling and formatting conventions for various text elements.
The theme supports standard Markdown headings, which can be styled with special classes.
1
2
3
4
5
6
7
8
9
10
11
# H1 — heading
{: .mt-4 .mb-0 }
## H2 — heading
{: data-toc-skip='' .mt-4 .mb-0 }
### H3 — heading
{: data-toc-skip='' .mt-4 .mb-0 }
#### H4 — heading
{: data-toc-skip='' .mt-4 }
Standard paragraph text is used for long-form content.
Several list types are available:
Ordered List:
Unordered List:
ToDo List:
Description List:
1
2
3
4
5
Sun
: the star around which the earth orbits
Moon
: the natural satellite of the earth, visible by reflected light from the sun
This line shows the block quote.
Standard markdown links are supported: <http://127.0.0.1:4000>
Footnotes can be created using [^name] and defined later in the document.
Example:
1
2
3
Click the hook will locate the footnote[^footnote].
[^footnote]: The footnote source
Use backticks for inline code.
Use the filepath class to style filepaths.
Example:
1
Here is the `/path/to/the/file.extend`{: .filepath}.
Renders as:
Here is the /path/to/the/file.extend.
Code blocks can be created with triple backticks. You can specify a language for syntax highlighting and an optional filename.
Specific Language:
1
2
3
4
if [ $? -ne 0 ]; then
echo "The command was not successful.";
#do the needful / exit
fi;
Specific Filename:
1
2
3
4
// _sass/jekyll-theme-chirpy.scss
@import
"colors/light-typography",
"colors/dark-typography";
To show Liquid code snippets without them being processed by Jekyll, either wrap them in and tags, or set render_with_liquid: false in the front matter (requires Jekyll 4.0+).
To avoid repeating paths, you can set prefixes.
cdn in _config.yml for a site-wide media host.media_subpath in a post’s front matter.The final URL is constructed as: [site.cdn/][page.media_subpath/]file.ext
Provide an image with a 1200 x 630 resolution (1.91:1 aspect ratio).
1
2
3
4
5
6
---
image:
path: /path/to/image.png
alt: A description of the image.
lqip: data:image/webp;base64,... # Optional Low Quality Image Placeholder
---
w and h are shortcuts for width and height.
1
{: w="700" h="400" }
.normal: Default, left-aligned..left / .right: Float the image..light and .dark classes.
1
2
{: .light }
{: .dark }
.shadow class for a shadow effect.Use Liquid include helpers to embed media.
1
{% include embed/youtube.html id='VIDEO_ID' %}
Embed local or remote video/audio files.
1
2
{% include embed/video.html src='/path/to/video.mp4' title='Demo' autoplay=true %}
{% include embed/audio.html src='/path/to/audio.mp3' title='Demo' %}
The theme provides special blockquote-style prompts to highlight information.
Tip:
An example showing the
tiptype prompt.
1
2
> An example showing the `tip` type prompt.
{: .prompt-tip }
Info:
An example showing the
infotype prompt.
1
2
> An example showing the `info` type prompt.
{: .prompt-info }
Warning:
An example showing the
warningtype prompt.
1
2
> An example showing the `warning` type prompt.
{: .prompt-warning }
Danger:
An example showing the
dangertype prompt.
1
2
> An example showing the `danger` type prompt.
{: .prompt-danger }
Standard Markdown tables with alignment are supported.
| Company | Contact | Country |
|---|---|---|
| Alfreds Futterkiste | Maria Anders | Germany |
| Island Trading | Helen Bennett | UK |
| Magazzini Alimentari Riuniti | Giovanni Rovelli | Italy |
To enable MathJax on a page, add math: true to the frontmatter.
Block-level equation:
1
2
3
$$
\sum_{n=1}^\infty 1/n^2 = \frac{\pi^2}{6}
$$
Inline equation: When $a \ne 0$, there are two solutions.
To enable Mermaid on a page, add mermaid: true to the frontmatter.
```mermaid gantt title Adding GANTT diagram functionality to mermaid apple :a, 2017-07-20, 1w banana :crit, b, 2017-07-23, 1d cherry :active, c, after b a, 1d