Coding指令測試集-1

蒐集了一些之後可能markdown會用到的指令

https://gohugo.io/content-management/shortcodes/#figure

This theme has 3 CSS classes made for figure elements:

  • big: images will break the width limit of main content area.
  • left: images will float to the left.
  • right: images will float to the right.

If a figure has no class set, the image will behave just like a normal markdown image: ![]().

Here are some examples

image

figure-normal (without any classes)

image

figure-big

image

figure-medium

image

figure-small

image

figure-tiny

image

figure-left

文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字

image

figure-right

文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字1文字

Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries.

In this example we will be using KaTeX

  • Create a partial under /layouts/partials/math.html
  • Within this partial reference the Auto-render Extension or host these scripts locally.
  • Include the partial in your templates like so:
{{ if or .Params.math .Site.Params.math }}
{{ partial "math.html" . }}
{{ end }}
  • To enable KaTex globally set the parameter math to true in a project’s configuration
  • To enable KaTex on a per page basis include the parameter math: true in content files

Note: Use the online reference of Supported TeX Functions

Examples

Inline math: \(\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\)

Block math:

$$ \varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } } $$

In this first part of the series we’ll show you how to create a series

As a first step we need to add series as a taxonomy. We can do this by editing the config.toml.
Note: We always need to define the existing taxonomies as well.

[taxonomies]
    category = "categories"
    series = "series"
    tag = "tags"

Now we have the series enabled, the next thing we need to do is add the series name in the FrontMatter. For our example we’ll use this post and the next part.

As you can see we’ve set the series to series-setup. We also do the same in the next parts of the series.
This end results should be a Front Matter that looks similar to this:

---
author: Chepei Ting
title: 修正版本
date: 2023-12-14
description: A brief guide to how to setup markdown language
series:
  - series-setup
---

Each individual post will now also show the other posts in the series under the Posts in this Series heading.

相關系列文章