Skip to content

polunwu/ssg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ssg

A simple static site generator written in Python. Converts Markdown files into HTML pages using a template.

How it works

  1. Static assets from static/ are copied to docs/
  2. Markdown files in content/ are recursively converted to HTML and written to docs/
  3. Each page is rendered using template.html, with {{ Title }} and {{ Content }} replaced

Usage

Serve locally:

bash main.sh

Opens a local server at http://localhost:8888.

Build for production (GitHub Pages):

bash build.sh

Generates output under docs/ with base path /ssg/.

Run tests:

bash test.sh

Project structure

content/      Markdown source files
static/       Static assets (CSS, images)
src/          Python source code
  block/      Markdown block parsing
  generate/   Page generation
  markdown/   Markdown-to-HTML conversion
  nodes/      HTML node tree types
  system/     File system utilities
  utils/      Helpers (title extraction, link/image parsing)
template.html Base HTML template
docs/         Generated output (don't edit directly)

About

A simple static site generator written in Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages