Hugo is a fast, flexible static site generator written in Go. It transforms Markdown content and templates into static HTML websites that are fast, secure, and easy to deploy. Hugo is ideal for research groups, project documentation, and academic portfolios.
Key Features
- Blazing fast: Build 1000s of pages in seconds
- Markdown-based: Write content in familiar Markdown format
- No dependencies: Single binary, no runtime dependencies
- Themes: Extensive collection of pre-built themes
- Live reload: Instant preview during development
- Multilingual: Built-in support for multiple languages
Why Hugo for Research?
Version control friendly:
- Plain text Markdown files work seamlessly with Git
- Track changes to content over time
- Collaborate on documentation with pull requests
Low maintenance:
- No databases or servers to maintain
- Static files deploy anywhere (GitHub Pages, Netlify, S3)
- No security vulnerabilities from dynamic backends
Integration with research workflows:
- Write content in the same Markdown used for Jupyter notebooks
- Include code snippets with syntax highlighting
- Embed equations with LaTeX support
- Link to papers, data, and code repositories
Getting Started
Install Hugo:
# macOS
brew install hugo
# Windows
winget install Hugo.Hugo.Extended
# Linux
sudo apt install hugo
Create a new site:
hugo new site my-research-site
cd my-research-site
# Add a theme
git init
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
echo "theme = 'ananke'" >> hugo.toml
# Create content
hugo new posts/my-first-post.md
# Start development server
hugo server -D
Visit http://localhost:1313 to see your site.
Content Organization
content/
├── _index.md # Homepage
├── about.md # About page
├── research/
│ ├── _index.md # Research section
│ ├── project-1.md
│ └── project-2.md
├── publications/
│ ├── _index.md
│ ├── 2024-nature.md
│ └── 2023-science.md
└── team/
├── _index.md
├── pi.md
└── grad-students.md
Example: Lab Website Content
content/research/neural-decoding.md:
---
title: "Neural Decoding of Movement Intention"
date: 2024-01-15
description: "Using machine learning to decode intended movements from motor cortex"
tags: ["neural decoding", "machine learning", "motor cortex"]
authors: ["Jane Smith", "John Doe"]
---
## Overview
This project investigates real-time decoding of movement intention from multi-electrode recordings in motor cortex.
## Methods
We recorded from 96 channels simultaneously during a reaching task...
### Analysis Pipeline
```python
from sklearn.linear_model import Ridge
from sklearn.model_selection import cross_val_score
# Train decoder
decoder = Ridge(alpha=1.0)
scores = cross_val_score(decoder, neural_features, movements, cv=5)
Results
Our decoder achieved 85% accuracy in predicting reach direction…
Publications
- Smith et al. (2024). Nature Neuroscience. DOI:10.1038/nn.1234
Code
Analysis code available at: github.com/lab/neural-decoding
## Shortcodes for Research Content
Hugo shortcodes enable reusable components:
```markdown
{{< figure src="results.png" title="Decoding accuracy" alt="Bar plot" >}}
{{< cite "smith2024" >}}
{{< github repo="username/project" >}}
{{< youtube id="dQw4w9WgXcQ" >}}
LaTeX Math Support
Configure in hugo.toml:
[markup.goldmark.extensions]
typographer = true
[markup.goldmark.extensions.passthrough]
enable = true
[markup.goldmark.extensions.passthrough.delimiters]
block = [['\[', '\]'], ['$$', '$$']]
inline = [['\(', '\)'], ['$', '$']]
Then use LaTeX in Markdown:
The firing rate follows a Poisson distribution:
$$
P(k; \lambda) = \frac{\lambda^k e^{-\lambda}}{k!}
$$
where inline math like $\lambda$ represents the rate parameter.
Taxonomies for Research
Define taxonomies in hugo.toml:
[taxonomies]
tag = 'tags'
category = 'categories'
author = 'authors'
project = 'projects'
technique = 'techniques'
Use in frontmatter:
---
title: "Spike Sorting Tutorial"
tags: ["electrophysiology", "data analysis"]
authors: ["Jane Smith"]
techniques: ["spike sorting", "clustering"]
projects: ["neural-decoding"]
---
Deployment Options
GitHub Pages (free):
# Build site
hugo
# Push to gh-pages branch
git subtree push --prefix public origin gh-pages
Netlify (free tier):
- Push Hugo site to GitHub
- Connect repository to Netlify
- Set build command:
hugo - Set publish directory:
public
GitLab Pages:
Create .gitlab-ci.yml:
pages:
image: klakegg/hugo:ext-alpine
script:
- hugo
artifacts:
paths:
- public
only:
- main
Common Research Site Patterns
Lab homepage:
- Hero section with research focus
- Recent publications
- Team members
- News/updates
Documentation site:
- Installation guides
- Tutorials and how-tos
- API reference
- Example galleries
Personal academic site:
- About/CV
- Publications list
- Research projects
- Blog/notes
Themes for Academic Sites
Popular themes for research:
- Academic: For academic portfolios and CVs
- Hugo Prose: Clean, minimal documentation theme
- Book: For documentation and tutorials
- Hugo Research Group: Specifically for research labs
When to Use Hugo
Best for:
- Lab and research group websites
- Project documentation
- Academic portfolios
- Research notes and tutorials
- Static content that updates periodically
Consider alternatives for:
- Interactive data dashboards (use Streamlit)
- Content management by non-technical users (use WordPress)
- Highly dynamic content (use Django/Flask)
- Real-time collaboration (use Wiki platforms)
Integration with Research Tools
Jupyter notebooks:
# Convert notebook to Markdown for Hugo
jupyter nbconvert --to markdown notebook.ipynb
mv notebook.md content/tutorials/
Bibliography management:
- Use Hugo data files (YAML/JSON) for publications
- Generate from BibTeX with scripts
- Create shortcodes for citations
Code snippets:
- Automatic syntax highlighting
- Support for 200+ languages
- Line numbers and highlighting