A dead simple blog generator
DSBG is a minimalist, single-binary static site generator written in Go. It transforms a directory of Markdown and HTML files into a clean, modern, and fast blog. It's designed to be simple to use, highly configurable, and easy to deploy.
- Fast: Single binary, no dependencies needed at runtime.
- Simple: Write content in Markdown, run one command, get a website.
- Modern: Includes a responsive design, dark mode, code highlighting, and MathJax support.
- Integrated Social Sharing: Built-in, optimized sharing for X, Mastodon, Bluesky, Threads, Facebook, Reddit, LinkedIn, Telegram, and Hacker News.
- Feature-Rich: Includes tag filtering, live search (Fuse.js), RSS feed generation, and easy content templating.
This README itself is an example of a page generated by DSBG. You can see it live here.
Quick Start1. Installation
Option A: Pre-built Binary
Download the latest pre-built binary for your operating system from the GitHub Releases page.
Option B: Go Install
If you have Go installed, you can build and install DSBG with a single command:
go install github.com/tesserato/dsbg@latest2. Create Content
Create a directory for your content (e.g., my-blog-content/) and add a Markdown file.
my-blog-content/2025-11-07-hello-world.md:
---
title: Hello, World!
description: This is my very first post using DSBG.
tags: [Welcome, Go, Tech]
coverImagePath: cover.jpg
---
This is the content of my first post. It's that simple!
You can include an image like this (place `cover.jpg` in the same folder):
3. Generate Your Site
Run the dsbg command, pointing it to your content directory.
dsbg -input-path my-blog-content/ -output-path public/ -title "My Awesome Blog"This will generate a complete static website in the public/ directory.
4. Preview Your Site (Watch Mode)
For live development, use the -watch flag. This starts a local web server and automatically rebuilds your site whenever you save a change.
dsbg -input-path my-blog-content/ -watchNow, open your browser to http://localhost:666 to see your blog.
Content Creation
DSBG content files are Markdown (.md) or HTML (.html) files with a frontmatter block at the top, which defines the metadata for the post.
Frontmatter Fields
--- title: The title of your post (required) description: A short summary of the post (required for previews) created: 2025-11-07 # Optional: uses file date if missing updated: 2025-11-08 # Optional: uses file date if missing coverImagePath: path/to/image.jpg # Optional: relative to the markdown file tags: [tag1, tag2, "Multi-word Tag"] # Optional: for filtering and sharing url: https://external-link.com # Optional: for Hacker News to link to an external site ---
Special PAGE Tag
If you add the tag PAGE,
DSBG will treat the article as a static page (like an "About Me" page).
It will appear in the main navigation bar at the top of the index
instead of in the article list.
Command-Line Flags
Use flags to configure your site's appearance and functionality. Run dsbg -h for a full list.
| Flag | Description | Default |
|---|---|---|
-title |
The main title of your blog. | "Blog" |
-description |
A description for the homepage (supports Markdown). | "This is my blog" |
-input-path |
Directory containing your content files. | "content" |
-output-path |
Directory where the static site will be generated. | "public" |
-base-url |
The final URL of your site (e.g., https://username.github.io). |
"" |
-watch |
Enable live preview server and automatic rebuilds on file changes. | false |
-theme |
Set a color theme (default, dark, clean, colorful). |
"default" |
-sort |
Article sort order (e.g., date-created, reverse-title). |
"date-created" |
-css-path |
Path to a custom CSS file to override the theme. | "" |
-favicon-path |
Path to a custom favicon.ico file. |
"" |
Social Sharing & Handles
DSBG automatically adds profile links and optimized share buttons. Set your handles using these flags:
| Flag | Example Handle |
|---|---|
-x-handle |
tesserato |
-bluesky-handle |
tesserato |
-threads-handle |
tesserato |
-mastodon-handle |
tesserato |
-reddit-handle |
tarjano |
-facebook-handle |
your.profile |
-linkedin-handle |
your-profile-id |
-telegram-handle |
tesserato |
-hackernews-handle |
dsbg_user |
Markdown Copy Button
Every article includes a "Copy Markdown" button, which copies a clean, formatted summary of the post to the clipboard, perfect for sharing on platforms like Discord or GitHub.
Content Templating
Quickly scaffold a new post using the template command.
# Creates a new .md file in the current directory with pre-filled frontmatter
dsbg -template -title "My New Post" -tags "Go, Example"Run dsbg -template -h for all available template flags.
The generated output directory (e.g., public/) contains a complete, self-contained static website. You can deploy it to any static hosting service, such as:
Simply upload the contents of the output directory to your host.
Contributing
This project is open-source. Contributions, bug reports, and feature requests are welcome! Please feel free to open an issue or submit a pull request on the GitHub repository.
Blogs using DSBG
My personal blog, and the motivation for DSBG. If you want to know more about why I made this, check out Why I made yet another blog generator.
from https://github.com/tesserato/dsbg

No comments:
Post a Comment