2.4 KiB
2.4 KiB
Sometimes Code Blog
A personal blog built with Hugo, designed for longevity and simplicity.
Quick Start
- Install Hugo:
brew install hugo - Clone with submodules:
git clone --recurse-submodules <repo-url> - Start development server:
hugo server --buildDrafts - View at: http://localhost:1313
Writing Content
New Post
hugo new content posts/my-new-post.md
Categories
- Use
categories = ['programming']for technical posts - Use
categories = ['family']for personal/family posts
Publishing
- Set
draft = falsein the frontmatter to publish
Project Structure
├── content/
│ ├── posts/ # Blog posts
│ └── resume.md # Resume page
├── themes/ananke/ # Hugo theme (git submodule)
├── hugo.toml # Site configuration
└── .github/workflows/ # Deployment automation
Deployment
Digital Ocean Setup
-
Server Requirements:
- Ubuntu 22.04+ droplet
- Nginx installed
- SSL certificate (use certbot)
-
GitHub Secrets (for automatic deployment):
DO_HOST: Your server IP or domainDO_USERNAME: SSH username (usuallyrootorubuntu)DO_SSH_KEY: Private SSH key for server access
-
Server Setup:
# Create web directory sudo mkdir -p /var/www/sometimescode.com # Copy nginx config sudo cp nginx-example.conf /etc/nginx/sites-available/sometimescode.com sudo ln -s /etc/nginx/sites-available/sometimescode.com /etc/nginx/sites-enabled/ # Get SSL certificate sudo certbot --nginx -d sometimescode.com -d www.sometimescode.com # Restart nginx sudo systemctl restart nginx
Manual Deployment
# Build site
hugo --minify
# Upload to server
scp -r public/* user@server:/var/www/sometimescode.com/
Development
- Theme: Ananke with custom dark mode
- Hugo Version: 0.150.0+
- Content Format: Markdown with YAML frontmatter
- Dark Mode: Custom CSS and JavaScript implementation with toggle button
Philosophy
This blog is built for longevity:
- Markdown files: Human-readable, future-proof content
- Static generation: No database dependencies
- Simple theme: Minimal dependencies, maximum compatibility
- Git history: Complete version control of all content
The goal is for this blog to be readable and maintainable for decades to come.