quangloc99 / quangloc99.github.io

My blog site. https://quangloc99.github.io/
https://quangloc99.github.io/
2 stars 1 forks source link
blog vitepress-blog

Scripts

For local note development.

bundle exec jekyll serve

Customization documentation

The layout custompost.html

This layout inherit the default post layout of jekyll. It is used to initialized some liquid global variables that used internally in this repo, as well as adding some components to the post. This layout should be used in order to use the components below.

Mathjax

To use mathjax inside the page, use the custompost layout, then include the following into the frontmatter:

---
mathjax: true
---

TOC

This repo has a custom TOC, which is a nice sidebar, generated with Javascript.

To have this custom TOC, use the custompost layout, then in the frontmatter:

---
toc: true  # Should be truthful
---

Usage

Frontmatter config
---
toc:
    # [Optional, default is 2]
    # The smallest header number to be included in TOC.
    lower_header_level: 2
    # [Optional, default is 6]
    # The biggest header number to be included in TOC. 
    upper_header_level: 3
---

Customhighlight

Along side with the default highlighting, this component provides:

Usage

Frontmatter config
---
customhighlight:
    # [Optional]
    # The default directory that contains the files to be included
    dir: some dir
    # [Optional]
    # Wether the component has its content _wrapped_
    wrap: true
---
Include
{% include customhighlight.html
    dir="some dir"
    file="filename.ext"
    content="string"
    noStrip=true/false
    ext="extension"
    collapsed=true/false
    wrap=true/false
%}

Image

This component allows to specify the following to an img element:

Usage

Frontmatter config
---
# [Optional]
# Specify the directory that contains the included images.
image_dir: some dir
---
Include
{% include image.html
    dir="some dir"
    file="filename.png"
    url=""
    caption="caption"
    alt="alt text"
%}

Utterances

Utterances is turned on by default when the custompost layout is used. Also note that it will not be showm for the development environment (it will refetch a lot of time otherwise).

Usage

Frontmatter config
---
utterances:
    # To disable utterances.
    disable: true
---