πŸ‘©πŸΌβ€πŸ« Teach academic courses

Oct 24, 2023 Β· 3 min read
Embed rich media such as videos and LaTeX math
Date
Oct 24, 2023 12:00 AM

Hugo Blox Builder is designed to give technical content creators a seamless experience. You can focus on the content and the Hugo Blox Builder which this template is built upon handles the rest.

Embed videos, podcasts, code, LaTeX math, and even test students!

On this page, you’ll find some examples of the types of technical content that can be rendered with Hugo Blox.

Video

Teach your course by sharing videos with your students. Choose from one of the following approaches:

Youtube:

{{< youtube w7Ft2ymGmfc >}}

Bilibili:

{{< bilibili id="BV1WV4y1r7DF" >}}

Video file

Videos may be added to a page by either placing them in your assets/media/ media library or in your page’s folder, and then embedding them with the video shortcode:

{{< video src="my_video.mp4" controls="yes" >}}

Podcast

You can add a podcast or music to a page by placing the MP3 file in the page’s folder or the media library folder and then embedding the audio on your page with the audio shortcode:

{{< audio src="ambient-piano.mp3" >}}

Try it out:

Test students

Provide a simple yet fun self-assessment by revealing the solutions to challenges with the spoiler shortcode:

{{< spoiler text="πŸ‘‰ Click to view the solution" >}}
You found me!
{{< /spoiler >}}

renders as

πŸ‘‰ Click to view the solution
You found me πŸŽ‰

Math

Hugo Blox Builder supports a Markdown extension for $\LaTeX$ math. You can enable this feature by toggling the math option in your config/_default/params.yaml file.

To render inline or block math, wrap your LaTeX math with {{< math >}}$...${{< /math >}} or {{< math >}}$$...$${{< /math >}}, respectively.

We wrap the LaTeX math in the Hugo Blox math shortcode to prevent Hugo rendering our math as Markdown.

Example math block:

{{< math >}}
$$
\gamma_{n} = \frac{ \left | \left (\mathbf x_{n} - \mathbf x_{n-1} \right )^T \left [\nabla F (\mathbf x_{n}) - \nabla F (\mathbf x_{n-1}) \right ] \right |}{\left \|\nabla F(\mathbf{x}_{n}) - \nabla F(\mathbf{x}_{n-1}) \right \|^2}
$$
{{< /math >}}

renders as

$$\gamma_{n} = \frac{ \left | \left (\mathbf x_{n} - \mathbf x_{n-1} \right )^T \left [\nabla F (\mathbf x_{n}) - \nabla F (\mathbf x_{n-1}) \right ] \right |}{\left \|\nabla F(\mathbf{x}_{n}) - \nabla F(\mathbf{x}_{n-1}) \right \|^2}$$

Example inline math {{< math >}}$\nabla F(\mathbf{x}_{n})${{< /math >}} renders as $\nabla F(\mathbf{x}_{n})$ .

Example multi-line math using the math linebreak (\\):

{{< math >}}
$$f(k;p_{0}^{*}) = \begin{cases}p_{0}^{*} & \text{if }k=1, \\
1-p_{0}^{*} & \text{if }k=0.\end{cases}$$
{{< /math >}}

renders as

$$ f(k;p_{0}^{*}) = \begin{cases}p_{0}^{*} & \text{if }k=1, \\ 1-p_{0}^{*} & \text{if }k=0.\end{cases} $$

Code

Hugo Blox Builder utilises Hugo’s Markdown extension for highlighting code syntax. The code theme can be selected in the config/_default/params.yaml file.

```python
import pandas as pd
data = pd.read_csv("data.csv")
data.head()
```

renders as

import pandas as pd
data = pd.read_csv("data.csv")
data.head()

Inline Images

{{< icon name="python" >}} Python

renders as

Python

Did you find this page helpful? Consider sharing it πŸ™Œ

Zheng Liu
Authors
Zheng Liu
Assistant Professor
Zheng Liu joined the University of Michigan-Dearborn Industrial and Manufacturing Systems Engineering Department as an Assistant Professor. His research bridges theoretical and applied aspects of AI in manufacturing and energy systems. He focused on physics-based modeling, physics-informed machine learning, and generative design for manufacturing and energy storage applications. He also evaluated the manufacturing processes through life cycle assessment and techno-economic analysis, helping the team win $1M Department of Energy’s (DOE) inaugural American-Made Geothermal Lithium Extraction Prize. He has collaborated on multiple projects funded by the National Science Foundation (NSF) through the Future Manufacturing Research Grant (FMRG) program, as well as the Office of Naval Research (ONR). In addition, he served as a graduate fellow and STEM outreach coordinator at the NSF Engineering Research Center for Power Optimization for Electro-Thermal Systems (POETS). Zheng has received the Sharp Outstanding Graduate Student Award and the Tau Beta Pi Outstanding Graduate Student Award in recognition of his research contributions. He has published more than 15 peer-reviewed journal articles and 15 conference proceedings, and has served as a track chair for the IEEE Transportation Electrification Conference. Through his work, he continues to push the frontiers of AI-driven innovation in manufacturing and energy systems.