Welcome to the Zhi theme demo! This is a simple blog theme for Hugo.
Features Dark/light theme toggle Code highlighting with copy button MathJax support Mermaid diagrams Video embedding (Bilibili/YouTube) Image lightbox Responsive design Code Example python 1 2 3 4 def hello(name: str) -> str: return f"Hello, {name}!" print(hello("World")) Math Inline math: $E = mc^2$
Bilibili Embed YouTube Embed Dual Platform (Geo-switching) When both Bilibili and YouTube IDs are provided, the player automatically selects the platform based on the viewer’s timezone:
Multiple Videos on One Page First video:
Second video:
Video with Surrounding Content This paragraph appears before the video embed. The video player should integrate smoothly with surrounding text content without layout shifts.
Note Shortcode Info Note Information This is an informational note. Use it to highlight important context or background knowledge that readers should be aware of. Tip Note Pro Tip This is a tip note. Use it to share helpful suggestions or shortcuts that improve the reader's workflow. Success Note Success This is a success note. Use it to confirm completed actions or positive outcomes. Warning Note Caution This is a warning note. Use it to alert readers about potential pitfalls or things to watch out for. Danger Note Stop This is a danger note. Use it to warn about critical issues that could cause data loss or system failure. Quote Shortcode Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world. Albert Einstein On Science
Flowchart mermaid graph TD A[Start] --> B{Decision} B -->|Yes| C[Process A] B -->|No| D[Process B] C --> E[Result] D --> E E --> F[End] Sequence Diagram mermaid sequenceDiagram participant Client participant Server participant Database Client->>Server: HTTP Request Server->>Database: SQL Query Database-->>Server: Result Set Server-->>Client: JSON Response Note over Client,Database: Full request-response cycle Class Diagram mermaid classDiagram class Animal { +String name +int age +makeSound() void } class Dog {
Inline Math The famous mass-energy equivalence: $E = mc^2$. The quadratic formula: $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$.
Euler’s identity is often considered the most beautiful equation in mathematics: $e^{i\pi} + 1 = 0$.
The normal distribution probability density function: $f(x) = \frac{1}{\sigma\sqrt{2\pi}} e^{-\frac{(x-\mu)^2}{2\sigma^2}}$.
Display Math The Gaussian integral:
$$ \int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi} $$
Maxwell’s equations in differential form:
$$ \nabla \cdot \mathbf{E} = \frac{\rho}{\varepsilon_0} $$
$$ \nabla \cdot \mathbf{B} = 0 $$
Headings H3 Heading This section tests third-level headings and their visual appearance in the TOC.
H4 Heading Fourth-level headings provide additional document structure. The TOC should respect maxDepth configuration.
Paragraphs This is a standard paragraph with bold text, italic text, inline code, and a hyperlink. These are the most common inline formatting elements used in technical writing.
A second paragraph to verify spacing. Hugo normalizes Markdown content using Goldmark, which follows the CommonMark specification. Paragraphs separated by blank lines receive proper <p> tags.