logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·04.11.26
← Back to news

Bashblog – a single bash script to create blogs

Original article
github.com|98 points|72 comments|by ludicrousdispla|Jun 28, 2026

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.sh into your server's public directory (e.g., $HOME/public_html/blog).
  • Ensure the script is executable by running chmod +x bb.sh.
  • Execute ./bb.sh to 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, and head.
  • 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 ftpfs to mount a remote folder and run the script locally.
  • 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.

asciinema

🛠️ 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:

MethodLocationBest For...
Direct Editglobal_variables() function inside bb.shQuick, one-time setups.
Config FileA separate .config file in the same folderUsers 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:

  1. Always quote your values.
  2. Do not use the $ sign when declaring variables.
  3. 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.pl is 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.

demo

🤝 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:

Complexity≈SLOC↑  ⟹  Maintainability↓\text{Complexity} \approx \text{SLOC} \uparrow \implies \text{Maintainability} \downarrowComplexity≈SLOC↑⟹Maintainability↓

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() or write_rss()).

All requests are discussed openly and civilly in the comments section.