Bashblog – a single bash script to create blogs
Bashblog: A Minimalist Blogging Engine
Bashblog is a streamlined solution for creating a personal blog using nothing more than a single Bash script. You can find the source code on GitHub at cfenollosa/bashblog.
"I created it because I wanted a very, very simple way to post entries to a blog by using a public folder on my server, without any special requirements and dependencies."
The project demonstrates that you don't need a heavy CMS to maintain a web presence; in fact, the documentation page itself was generated 100% by bashblog without any manual edits.
🛠️ Getting Started
To get your blog up and running, follow this checklist:
- Download the source code.
- Move
bb.shinto your server's public directory (e.g.,$HOME/public_html/blog). - Ensure the script is executable by running
chmod +x bb.sh. - Execute
./bb.shto view the command menu.
Creating Content
To write your first entry, simply execute:
./bb.sh post
The script will attempt to use Markdown if it is installed on your system. If you prefer to write in raw HTML, use the following flag:
./bb.sh post -html
Once finished, your post will be live at your public URL (for instance, http://server.com/~username/blog). For advanced customization like footers or static pages, refer to the project wiki.
⚙️ System Workflow
The following diagram illustrates how bashblog processes your input:
🚀 Key Features
Bashblog is designed for maximum compatibility and minimum overhead.
- Extreme Simplicity: Write in your preferred editor; the script handles the deployment.
- Zero Dependencies: It relies solely on base utilities such as
date,basename,grep,sed, andhead. - Cross-Platform: Works on GNU/Linux, BSD, and OSX. It includes "magic" logic to auto-detect system-specific command switches, meaning
you don't need GNU coreutils on a Mac. - Flexible Access: Requires only shell access to a public folder.
- Pro Tip: Advanced users can use
ftpfsto mount a remote folder and run the script locally.
- Pro Tip: Advanced users can use
- Built-in Tooling:
- Automatic RSS generation.
- Draft support for unfinished posts.
- Clean, integrated CSS for immediate styling.
- Support for tags and categories.
- Integrations: Compatible with Markdown, Disqus, Twitter, Feedburner, and Google Analytics.

🛠️ Configuration
While you can test the script immediately, a permanent blog requires personalization. You can configure the blog's identity (title, author, etc.) using two different methods:
| Method | Location | Best For... |
|---|---|---|
| Direct Edit | global_variables() function inside bb.sh | Quick, one-time setups. |
| Config File | A separate .config file in the same folder | Users who want to update the script via git without losing settings. |
Note on .config logic: The script loads internal defaults first, then overwrites them with values found in .config. You only need to define the variables you wish to change.
Configuration Syntax
The .config file follows a strict format:
variable_name="value"
Crucial rules:
- Always quote your values.
- Do not use the
$sign when declaring variables. - Do not put spaces around the
=sign.
The script utilizes the $EDITOR environment variable to determine which text editor to launch.
🔍 Detailed Capabilities
- Design: A minimalist, readable layout focused entirely on content.
- Markdown: Supported via third-party libraries (Gruber's
Markdown.plis recommended). - URL Structure: Each post gets its own HTML page using the title as the URL.
- Organization:
- Configurable number of posts on the homepage.
- Automatic index of all posts.
- Dedicated pages for each tag.
- Social & Analytics:
- Twitter-based comments and a cookieless sharing option (EU cookie law compliant).
- Disqus integration.
- Google Analytics support.
- Standards: Full W3C validation for XHTML, CSS, and RSS.
- Safety: Every new post triggers an automatic site backup saved as
.backup.tar.gz.
![]()
🤝 Contributing
The project philosophy is centered on minimalism. The codebase has grown from 500 to over 1,000 lines of code (SLOC). To maintain clarity, the author follows a strict growth formula:
Because of this, any and all features are welcome only strongly justified features will be merged.
Pull Request Guidelines:
- Fix a specific use case (e.g., internationalization).
- Add a common, high-value feature (e.g., Disqus).
- Keep changes small (ideally just a few lines).
- Avoid major architectural rewrites (e.g., do not break
create_html_file()orwrite_rss()).
All requests are discussed openly and civilly in the comments section.