one of my goals with this site was to try to create it in a simple way. I use Svelte for work, and enjoy using it, but I never really made a site without a large framework. so this is my attempt at making it as barebones as I feel comfortable.
motivation
tools
+ html <-- markup
+ tailwindcss <-- css
+ pnpm <-- package management
+ jinja <-- templating
+ cloudflare <-- hosting
note: i could definitely do away with pnpm
build process
write html
↓
add tailwind classes
↓
build with jinja
↓
push to github
↓
deploy to cloudflare
project structure
.
├── build.py
├── node_modules
├── package.json
├── pnpm-lock.yaml
├── public
│ ├── articles
│ ├── articles.html
│ ├── assets
│ ├── blog.html
│ ├── css
│ ├── index.html
│ └── projects.html
├── pyproject.toml
├── README.md
├── tailwind
│ └── input.css
└── templates
├── base.html
└── pages
build script
python
fromjinja2importEnvironment,FileSystemLoaderfrom pathlib importPathenv =Environment(loader=FileSystemLoader('templates')) base_in_dir =Path('templates/pages') base_out_dir =Path('public') base_out_dir.mkdir(exist_ok=True) pages = base_in_dir.rglob('*.html')forpageinpages:relative_to(base_in_dir) out_path = base_out_dir / rel_path out_path.parent.mkdir(parents=True, exist_ok=True)withopen(page)asf: content_template = env.from_string(f.read()) content = content_template.render()base = env.get_template('base.html') html = base.render(title=page.stem.capitalize(),content=content)withopen(out_path, 'w')asf: f.write(html)