A minimal static website. Includes a simple markdown to html generator.
-
Build the site:
uv run build.py
-
View the site:
open `public/index.html` # or open in your browser
For deployment, github pages expects the site index.html to be in the root directory in the gh-pages branch. To avoid polluting the main branch with built files, we create a clean branch and copy the built files to the root directory each time we deploy.
# Delete the gh-pages branch (if it exists)
git branch -D gh-pages
# Build the site
uv run build.py
# Create and switch to gh-pages branch (which is the branch that GitHub Pages uses)
git switch -c gh-pages
# Copy built files to the root directory (which is the branch that GitHub Pages uses)
cp -r public/* .
# Commit and push
git add .
git commit -m "Update site"
# force push to overwrite the remote gh-pages branch if it exists
git push --force origin gh-pages
# Switch back to main branch
git switch mainAlternatively, you can run the deploy.sh script, which does the above steps:
./deploy.sh├── build.py # Static site generator script
├── pyproject.toml # Python dependencies
├── uv.lock # Python dependencies
├── content/ # Content source files
│ ├── blog/ # Blog posts (Markdown)
│ └── assets/ # Static assets
│ ├── images/ # Images (including profile photo)
│ └── papers/ # Research papers (PDFs)
├── templates/ # HTML templates
│ ├── base.html # Base template with common HTML structure
│ ├── homepage.html # Homepage layout
│ └── post.html # Blog post layout
└── public/ # Generated website (output)
├── index.html # Homepage
├── blog/ # Individual blog post pages
└── assets/ # Copied static assets
-
Create a new Markdown file in
content/blog/with the naming convention:YYYY-MM-DD-post-title.md -
Add YAML frontmatter at the top:
--- title: Your Post Title --- Your content here...
-
Run the build script:
python build.py
Edit the configuration in build.py to customize:
- Your name and bio
- Research description
- Publications list
- Blog description
Example configuration:
self.config = {
'name': 'Your Name',
'bio': '<p>Your bio here...</p>',
'research_description': 'Description of your research...',
'blog_description': 'What you blog about...',
'publications': [
{
'title': 'Paper Title',
'year': 2024,
'authors': 'Author List',
'venue': 'Conference/Journal Name',
'pdf_url': 'assets/papers/paper.pdf',
'arxiv_url': 'https://arxiv.org/abs/...'
}
]
}- Profile photo: Place profile image at
content/assets/images/profile.jpg - Research papers: Add PDFs to
content/assets/papers/ - Other images: Add to
content/assets/images/
You can use Python's built-in server to preview your site:
# After building
cd public
uv run python -m http.server 8000Then visit http://[::]:8000 in your browser.
The site uses Pico.css for styling. You can:
- Customize colors: Pico.css supports CSS custom properties
- Add custom CSS: Edit the
<style>section intemplates/base.html - Override Pico defaults: Add your own CSS rules
The site uses three templates:
base.html: Common HTML structure, includes Pico.csshomepage.html: Layout for the main pagepost.html: Layout for individual blog posts
Templates use simple {{ variable }} syntax for content replacement.