mettu (మెట్లు, /ˈmɛt.t̪u/) is a simple static site generator that uses Python for backend processing and Vite for frontend development, with Tailwind and DaisyUI for styling. It allows you to create static websites using markdown files.
"mettu" is a Telugu word meaning a stair or step. It felt like a great name given that this project is a step towards building tools myself, and convieniently, a step towards making a site!
- Python 3.x
- Node.js and npm
- Vite
- Tailwind CSS and DaisyUI
-
Clone the repository
-
Install the required dependencies
npm install
- Note: Python dependencies are installed by default by the initialising script.
-
Configure Environment Variables (Optional - for S3 Upload)
Copy the example environment file:
cp .env.example .env
Edit
.envto add your S3 bucket credentials. This is required if you want optimized images to be uploaded to an S3-compatible bucket. -
Edit the
config.yamlfile to set your site name, author, runtime configuration, navigation links, syntax highlighting theme, and DaisyUI theme preferences.runtime: python_executable: "python3" # optional, defaults to python3 when omitted theme: default: "cupcake" # active theme used for data-theme include: ["cupcake", "dracula"] # DaisyUI presets to load custom: mytheme: primary: "#570df8" secondary: "#f000b8" accent: "#37cdbe" images: formats: - webp - jpg
Optionally, define site-wide font imports and the families to apply:
fonts: imports: - "https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Space+Grotesk:wght@500;700&display=swap" families: body: "'Inter', sans-serif" heading: "'Space Grotesk', sans-serif" mono: "'JetBrains Mono', monospace" syntax: pygments_theme: "dracula" # Controls syntax.css and markdown highlighting
You can still override the interpreter via the
PY_EXECUTABLEenvironment variable if needed, but the config file is the canonical source. -
Create markdown files in the
contentdirectory.- Dynamic Routing: Nested directories are supported (e.g.,
content/blog/post-1.mdbecomes/blog/post-1.html). - Each file should start with frontmatter similarly to the given examples.
- Dynamic Routing: Nested directories are supported (e.g.,
-
Templates and svg icons are located in the
templatesdirectory. You can customize them as needed. -
Assets like css, images, etc are placed in the
assetsdirectory.- Image Optimization: Images in
assets/imgare automatically processed and converted to WebP. - S3 Upload: If configured in
.env, processed images are uploaded to the specified S3 bucket.
- Image Optimization: Images in
-
Run the development server
npm run dev
-
Build the site for production
npm run build