|
| 1 | ++++ |
| 2 | +title = "Hello World: A Markdown Feature Showcase" |
| 3 | +date = 2025-08-03 |
| 4 | +description = "A demonstration of Markdown features including tables, LaTeX math, and syntax highlighting" |
| 5 | + |
| 6 | +[taxonomies] |
| 7 | +tags = ["markdown", "demo", "hello-world"] |
| 8 | ++++ |
| 9 | + |
| 10 | +Welcome to my new blog! This post demonstrates various Markdown features supported by Zola, including tables, LaTeX math rendering, and code syntax highlighting. |
| 11 | + |
| 12 | +<!-- more --> |
| 13 | + |
| 14 | +## Markdown Tables |
| 15 | + |
| 16 | +Here's an example of a Markdown table showing different programming languages and their features: |
| 17 | + |
| 18 | +| Language | Type System | Paradigm | Year Created | |
| 19 | +|----------|-------------|----------|--------------| |
| 20 | +| Python | Dynamic | Multi-paradigm | 1991 | |
| 21 | +| Rust | Static | Systems | 2010 | |
| 22 | +| JavaScript | Dynamic | Multi-paradigm | 1995 | |
| 23 | +| Go | Static | Concurrent | 2009 | |
| 24 | +| Haskell | Static | Functional | 1990 | |
| 25 | + |
| 26 | +Tables can also be aligned: |
| 27 | + |
| 28 | +| Left Aligned | Center Aligned | Right Aligned | |
| 29 | +|:-------------|:--------------:|--------------:| |
| 30 | +| Cell 1 | Cell 2 | Cell 3 | |
| 31 | +| Lorem | Ipsum | Dolor | |
| 32 | +| Sit | Amet | Consectetur | |
| 33 | + |
| 34 | +## LaTeX Math Rendering |
| 35 | + |
| 36 | +Zola supports both inline and display math using KaTeX. Here are some examples: |
| 37 | + |
| 38 | +### Inline Math |
| 39 | + |
| 40 | +The quadratic formula is $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$, which gives us the roots of a quadratic equation. |
| 41 | + |
| 42 | +Euler's identity is often cited as the most beautiful equation in mathematics: $e^{i\pi} + 1 = 0$. |
| 43 | + |
| 44 | +### Display Math |
| 45 | + |
| 46 | +The Gaussian integral: |
| 47 | + |
| 48 | +$$\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$$ |
| 49 | + |
| 50 | +Maxwell's equations in differential form: |
| 51 | + |
| 52 | +$$\begin{align} |
| 53 | +\nabla \cdot \mathbf{E} &= \frac{\rho}{\epsilon_0} \\ |
| 54 | +\nabla \cdot \mathbf{B} &= 0 \\ |
| 55 | +\nabla \times \mathbf{E} &= -\frac{\partial \mathbf{B}}{\partial t} \\ |
| 56 | +\nabla \times \mathbf{B} &= \mu_0 \mathbf{J} + \mu_0 \epsilon_0 \frac{\partial \mathbf{E}}{\partial t} |
| 57 | +\end{align}$$ |
| 58 | + |
| 59 | +The definition of the Fourier transform: |
| 60 | + |
| 61 | +$$\hat{f}(\xi) = \int_{-\infty}^{\infty} f(x) e^{-2\pi i x \xi} dx$$ |
| 62 | + |
| 63 | +## Code Syntax Highlighting |
| 64 | + |
| 65 | +Zola provides excellent syntax highlighting for various programming languages. Here are some examples: |
| 66 | + |
| 67 | +### Python |
| 68 | + |
| 69 | +```python |
| 70 | +def fibonacci(n): |
| 71 | + """Generate Fibonacci sequence up to n terms.""" |
| 72 | + if n <= 0: |
| 73 | + return [] |
| 74 | + elif n == 1: |
| 75 | + return [0] |
| 76 | + |
| 77 | + sequence = [0, 1] |
| 78 | + for i in range(2, n): |
| 79 | + next_num = sequence[i-1] + sequence[i-2] |
| 80 | + sequence.append(next_num) |
| 81 | + |
| 82 | + return sequence |
| 83 | + |
| 84 | +# Example usage |
| 85 | +fib_numbers = fibonacci(10) |
| 86 | +print(f"First 10 Fibonacci numbers: {fib_numbers}") |
| 87 | +``` |
| 88 | + |
| 89 | +### Rust |
| 90 | + |
| 91 | +```rust |
| 92 | +use std::collections::HashMap; |
| 93 | + |
| 94 | +#[derive(Debug)] |
| 95 | +struct User { |
| 96 | + id: u32, |
| 97 | + name: String, |
| 98 | + email: String, |
| 99 | +} |
| 100 | + |
| 101 | +impl User { |
| 102 | + fn new(id: u32, name: String, email: String) -> Self { |
| 103 | + User { id, name, email } |
| 104 | + } |
| 105 | + |
| 106 | + fn display(&self) { |
| 107 | + println!("User {}: {} ({})", self.id, self.name, self.email); |
| 108 | + } |
| 109 | +} |
| 110 | + |
| 111 | +fn main() { |
| 112 | + let mut users: HashMap<u32, User> = HashMap::new(); |
| 113 | + |
| 114 | + users.insert(1, User::new(1, "Alice".to_string(), "alice@example.com".to_string())); |
| 115 | + users.insert(2, User::new(2, "Bob".to_string(), "bob@example.com".to_string())); |
| 116 | + |
| 117 | + for (_, user) in &users { |
| 118 | + user.display(); |
| 119 | + } |
| 120 | +} |
| 121 | +``` |
| 122 | + |
| 123 | +### JavaScript |
| 124 | + |
| 125 | +```javascript |
| 126 | +// Modern ES6+ JavaScript example |
| 127 | +class TodoList { |
| 128 | + constructor() { |
| 129 | + this.todos = []; |
| 130 | + this.nextId = 1; |
| 131 | + } |
| 132 | + |
| 133 | + addTodo(text) { |
| 134 | + const todo = { |
| 135 | + id: this.nextId++, |
| 136 | + text, |
| 137 | + completed: false, |
| 138 | + createdAt: new Date() |
| 139 | + }; |
| 140 | + this.todos.push(todo); |
| 141 | + return todo; |
| 142 | + } |
| 143 | + |
| 144 | + toggleTodo(id) { |
| 145 | + const todo = this.todos.find(t => t.id === id); |
| 146 | + if (todo) { |
| 147 | + todo.completed = !todo.completed; |
| 148 | + } |
| 149 | + } |
| 150 | + |
| 151 | + getActiveTodos() { |
| 152 | + return this.todos.filter(todo => !todo.completed); |
| 153 | + } |
| 154 | +} |
| 155 | + |
| 156 | +// Usage with async/await |
| 157 | +async function fetchAndAddTodos() { |
| 158 | + const todoList = new TodoList(); |
| 159 | + |
| 160 | + try { |
| 161 | + const response = await fetch('/api/todos'); |
| 162 | + const todos = await response.json(); |
| 163 | + |
| 164 | + todos.forEach(todo => { |
| 165 | + todoList.addTodo(todo.text); |
| 166 | + }); |
| 167 | + |
| 168 | + console.log(`Added ${todos.length} todos`); |
| 169 | + } catch (error) { |
| 170 | + console.error('Failed to fetch todos:', error); |
| 171 | + } |
| 172 | +} |
| 173 | +``` |
| 174 | + |
| 175 | +### HTML/CSS |
| 176 | + |
| 177 | +```html |
| 178 | +<!DOCTYPE html> |
| 179 | +<html lang="en"> |
| 180 | +<head> |
| 181 | + <meta charset="UTF-8"> |
| 182 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 183 | + <title>Semantic HTML Example</title> |
| 184 | + <style> |
| 185 | + :root { |
| 186 | + --primary-color: #007bff; |
| 187 | + --text-color: #333; |
| 188 | + --bg-color: #f8f9fa; |
| 189 | + } |
| 190 | + |
| 191 | + body { |
| 192 | + font-family: system-ui, -apple-system, sans-serif; |
| 193 | + color: var(--text-color); |
| 194 | + background-color: var(--bg-color); |
| 195 | + line-height: 1.6; |
| 196 | + } |
| 197 | + |
| 198 | + .card { |
| 199 | + background: white; |
| 200 | + border-radius: 8px; |
| 201 | + padding: 1.5rem; |
| 202 | + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); |
| 203 | + transition: transform 0.2s ease; |
| 204 | + } |
| 205 | + |
| 206 | + .card:hover { |
| 207 | + transform: translateY(-2px); |
| 208 | + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); |
| 209 | + } |
| 210 | + </style> |
| 211 | +</head> |
| 212 | +<body> |
| 213 | + <main> |
| 214 | + <article class="card"> |
| 215 | + <h1>Welcome to Semantic HTML</h1> |
| 216 | + <p>Using proper HTML5 semantic elements improves accessibility and SEO.</p> |
| 217 | + </article> |
| 218 | + </main> |
| 219 | +</body> |
| 220 | +</html> |
| 221 | +``` |
| 222 | + |
| 223 | +## Conclusion |
| 224 | + |
| 225 | +This blog is now set up with: |
| 226 | + |
| 227 | +- ✅ Zola static site generator |
| 228 | +- ✅ Pico CSS for clean, semantic styling |
| 229 | +- ✅ KaTeX for beautiful math rendering |
| 230 | +- ✅ Syntax highlighting for code blocks |
| 231 | +- ✅ Responsive design out of the box |
| 232 | + |
| 233 | +Feel free to explore these features and start writing your own posts! |
0 commit comments