Introduction

Aug. 3, 2019

Hugo is an open-source project and lives by the work of its contributors. There are plenty of open issues, and we need your help to make Hugo even more awesome. You don’t need to be a Go guru to contribute to the project’s development.

$$a = 2$$

Assumptions

This contribution guide takes a step-by-step approach in hopes of helping newcomers. Therefore, we only assume the following:

Install Go

The installation of Go should take only a few minutes. You have more than one option to get Go up and running on your machine.

If you are having trouble following the installation guides for Go, check out Go Bootcamp, which contains setups for every platform or reach out to the Hugo community in the Hugo Discussion Forums.

Install Go From Source

Download the latest stable version of Go and follow the official Go installation guide.

Once you’re finished installing Go, let’s confirm everything is working correctly. Open a terminal—or command line under Windows–and type the following:

go version

You should see something similar to the following written to the console. Note that the version here reflects the most recent version of Go as of the last update for this page:

go version go1.12 darwin/amd64

Next, make sure that you set up your GOPATH as described in the installation guide.

You can print the GOPATH with echo $GOPATH. You should see a non-empty string containing a valid path to your Go workspace; for example:

/Users/<yourusername>/Code/go
#include <iostream>
using namespace std;

int main() {
    int i = 0;
}

LaTeX公式渲染测试

在Hugo中使用Goldmark的Passthrough扩展和KaTeX实现LaTeX公式渲染。

行内公式

质能方程 $E=mc^2$ 由爱因斯坦提出。

欧拉公式 $e^{i\pi} + 1 = 0$ 被誉为最美丽的数学公式之一。

行间公式

牛顿第二定律:

$$F = m \cdot a$$

麦克斯韦方程组:

$$ \begin{align} \nabla \times \vec{E} &= -\frac{\partial \vec{B}}{\partial t} \\ \nabla \times \vec{B} &= \mu_0 \vec{J} + \mu_0 \varepsilon_0 \frac{\partial \vec{E}}{\partial t} \\ \nabla \cdot \vec{E} &= \frac{\rho}{\varepsilon_0} \\ \nabla \cdot \vec{B} &= 0 \end{align} $$

复杂公式

高斯积分公式:

$$\oint_{\partial \Omega} \vec{E} \cdot d\vec{S} = \frac{1}{\varepsilon_0} \int_{\Omega} \rho(\vec{r}) dV$$

拉普拉斯变换:

$$\mathcal{L}\{f(t)\} = F(s) = \int_{0}^{\infty} f(t) e^{-st} dt$$

矩阵

$$A = \begin{pmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{pmatrix}$$

方程组

$$\begin{cases} x + y + z = 1 \\ 2x + y = 3 \\ 5z = 10 \end{cases}$$

分段函数

$$f(x) = \begin{cases} x^2, & \text{if}\ x \geq 0 \\ -x^2, & \text{if}\ x < 0 \end{cases}$$