Welcome to Toxic by Sohoxic, a simple, fast and lightweight static site generator which was primarily designed to help me easily document my life by keeping notes, learnings, thoughts all in one place instead of making static website for everything everytime, thus prioritising easy website building. This is the gardener of my digital garden(the initiator and the master to convert markdown files to static websites.).
For my fellow develops who wants to transform their lives in the similar way which I did, here's toxic for you to document your life, learnings etc.
Why Choose Toxic? If your focus is more on content rather than configuration, then toxic is for you
The Philosophy Behind Toxic
Toxic was created with three core principles in mind:
- Simplicity: No unnecessary complexity or bloat. You should be painlessly able to write
.mdfiles without having to worry about setting up and using your ssg. - Performance: Ease of use should be the priority with faster processing and build times. We have parallel processing in place to take care of this.
- Aesthetics: Tokyonight theme. I love this! If you don't you can always customise, toxic has given you all the flexibility to do so.
Toxic does all of this, with style. Haha!
Prerequisites
- Python 3.7 or higher
- pip (Python package installer)
Project Structure
your-site/
├── toxic.py # The static site generator script
├── content/ # Your markdown files go here
├── templates/ # HTML templates
├── assets/ # Static assets (CSS, images, etc.)
│ └── css/
│ └── style.css
└── dist/ # Generated site (output directory)
Installation
- Clone this repository or download the files:
git clone https://github.com/Sohoxic/toxic.git
cd toxic
- Install required dependencies:
pip install -r requirements.txt
Usage
1. Create a New Post
Create a markdown file in the content directory with YAML frontmatter:
---
title: My First Post
template: default.html
---
# Welcome to My Blog
This is my first blog post.
2. Build the Site
Run the generator:
python toxic.py
3. View Your Site
Open dist/your-post.html in a web browser to see your generated page.
Customization Options
Modifying the Theme
The dark theme CSS is located in assets/css/style.css. You can modify:
- Color schemes
- Typography
- Layout structure
Template Customization
Modify templates/default.html to change the HTML structure.
Technical Details
Here's a breakdown of Toxic's key components:
| Component | Technology | Purpose |
|---|---|---|
| Parser | Python-Markdown | Content Processing |
| Templates | Jinja2 | Layout Generation |
| Styling | Modern CSS | Visual Presentation |
| Configuration | YAML | Site Customization |
| Build System | Python | Site Generation |
Deployment
GitHub Pages
- Create a new repository on GitHub
- Push your code:
git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin <your-github-repo-url>
git push -u origin main
- Enable GitHub Pages in repository settings
- Set the source to the
distdirectory
Netlify
- Create a
netlify.toml:
[build]
publish = "dist"
command = "python generator.py"
- Connect your repository to Netlify
- Deploy!
Vercel
- Create a
vercel.json:
{
"buildCommand": "python toxic.py",
"outputDirectory": "dist"
}
- Connect your repository to Vercel
- Deploy!