https://dushyant.ahuja.ws/wp-admin//wp-content/uploads/# Install Hugo (choose your OS)
# Windows (with Chocolatey)
choco install hugo-extended
# macOS (with Homebrew)
brew install hugo
# Linux (Ubuntu/Debian)
sudo apt-get install hugo
# Verify installation
hugo version# Create new Hugo site
hugo new site dushyant-blog
cd dushyant-blog
# Initialize git repository
git init# Example with popular themes (choose one)
# Option 1: PaperMod (clean, fast)
git submodule add https://github.com/adityatelange/hugo-PaperMod.git themes/PaperMod
# Option 2: Ananke (Hugo default)
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
# Option 3: Mainroad (blog-focused)
git submodule add https://github.com/Vimux/Mainroad.git themes/MainroadCreate/edit config.yaml:
baseURL: 'https://dushyant.ahuja.ws'
languageCode: 'en-us'
title: "Dushyant's thoughts"
theme: 'PaperMod' # or your chosen theme
params:
author: 'Dushyant'
description: 'Personal blog and project showcase'
menu:
main:
- name: 'Home'
url: '/'
weight: 10
- name: 'Posts'
url: '/posts/'
weight: 20
- name: 'Categories'
url: '/categories/'
weight: 30
taxonomies:
category: categories
tag: tags# Install the converter
npm install -g wordpress-export-to-markdown
# Convert your WordPress export
wordpress-export-to-markdown --input=your-export.xml --output=content/posts
# Alternative: Manual Python script approach
pip install python-frontmatter markdownAfter conversion, you'll need to:
content/posts/---
title: "The Discworld Table"
date: 2025-08-19T00:00:00Z
categories: ["Personal", "Projects"]
tags: ["3d-printing", "discworld"]
draft: false
---# Create static directory structure
mkdir -p static/images
mkdir -p static/uploads
# Copy your WordPress uploads
cp -r /path/to/wp-uploads/* static/uploads/
# Update image references in posts
# Change: https://dushyant.ahuja.ws/wp-content/uploads/2025/08/image.jpg
# To: /uploads/2025/08/image.jpg# Build and serve locally
hugo server -D
# Visit http://localhost:1313 to preview
# Check all pages, images, and navigation work correctly# SSH into your VPS
ssh user@your-vps-ip
# Update system
sudo apt update && sudo apt upgrade -y
# Install nginx
sudo apt install nginx -y
# Install certbot for SSL
sudo apt install certbot python3-certbot-nginx -y
# Optional: Install git for deployment
sudo apt install git -yCreate /etc/nginx/sites-available/dushyant.ahuja.ws:
server {
listen 80;
server_name dushyant.ahuja.ws www.dushyant.ahuja.ws;
root /var/www/dushyant.ahuja.ws;
index index.html;
# Gzip compression
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
location / {
try_files $uri $uri/ =404;
}
# Cache static assets
location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
}# Enable the site
sudo ln -s /etc/nginx/sites-available/dushyant.ahuja.ws /etc/nginx/sites-enabled/
# Test nginx configuration
sudo nginx -t
# Restart nginx
sudo systemctl restart nginx
# Get SSL certificate
sudo certbot --nginx -d dushyant.ahuja.ws -d www.dushyant.ahuja.ws# Build the site locally
hugo --minify
# Upload to VPS (from your local machine)
rsync -avz --delete public/ user@your-vps:/var/www/dushyant.ahuja.ws/
# Or set up git-based deployment on VPS
sudo mkdir -p /var/www/dushyant.ahuja.ws
sudo chown $USER:$USER /var/www/dushyant.ahuja.ws
git clone your-repo-url /var/www/dushyant.ahuja.ws-source
cd /var/www/dushyant.ahuja.ws-source
hugo --minify -d /var/www/dushyant.ahuja.wsCreate a deploy script /home/user/deploy.sh:
#!/bin/bash
cd /var/www/dushyant.ahuja.ws-source
git pull origin main
hugo --minify -d /var/www/dushyant.ahuja.ws
sudo systemctl reload nginxTo maintain SEO, set up redirects from old WordPress URLs:
# Add to your nginx config
location ~ ^/\d{4}/\d{2}/\d{2}/(.+)/?$ {
return 301 /posts/$1/;
}
location /category/ {
return 301 /categories/;
}/index.xmlsudo certbot renew --dry-run