Development notes, release, and insights on BSSG - Bash Static Site Generator

Announcing BSSG 0.11.0: Site Initialization, Workflow Boosts, and More!

Published on: 14-04-2025 10:41:22 • Updated on: 14-04-2025 10:47:00 • 3 min read

Hot on the heels of the last release, I'm thrilled to announce BSSG version 0.11.0 is here! This version introduces a major new way to manage your sites, streamlines common workflows, adds useful content features, and improves overall robustness.

Key Highlights in 0.11.0

Introducing Site Initialization (init)

This is the headline feature! BSSG now includes an init <directory> command.

  • What it does: Creates a new, clean site structure in the specified directory (~/mysite, ./my-new-blog, etc.). This structure includes standard directories (src/, output/, static/, drafts/) and a site-specific configuration file (config.sh.local).
  • Why it's great: This allows you to keep your website's content completely separate from the BSSG core installation. Updating BSSG becomes much simpler (just update the core installation), and your site content remains organized independently. The generated config.sh.local automatically sets up the OUTPUT_DIR for the new site.

Enhanced Content Management

  • Automatic lastmod Handling:
    • When creating new posts or pages (./bssg.sh post, ./bssg.sh page), the lastmod frontmatter field is now automatically generated, initially matching the date.
    • When editing existing posts or pages (./bssg.sh edit), the lastmod field is automatically updated to the current date and time before the editor opens. This ensures your modification dates are always accurate in sitemaps, RSS feeds, and the "Updated on" notice without manual effort.
  • Full Content in RSS: A new RSS_INCLUDE_FULL_CONTENT variable in config.sh (defaulting to false) lets you choose whether to include the complete post content within the <description> tag of your RSS feed items.
  • Drafts Support: You can now configure a specific DRAFTS_DIR (defaults to drafts/) in config.sh. Draft posts and pages can be managed separately and listed using the improved list command (see below).
  • Custom CSS Injection: Easily add your own custom styles! Define a CUSTOM_CSS variable in config.sh pointing to a CSS file within your $STATIC_DIR (e.g., static/custom.css). BSSG will automatically link this stylesheet after the theme's CSS in your site's header.

Improved Workflow & Consistency

  • Centralized Configuration: Configuration loading (config.sh, config.sh.local) is now handled centrally within bssg.sh. This ensures all commands (post, page, edit, build, etc.) use the same consistent settings and correctly expanded paths (including ~).
  • Robust Editor Fallback: The helpful vi fallback and instructions (when EDITOR isn't set and nano is missing) are now consistently applied to the page command, mirroring the post command behavior.
  • Automatic Rebuild for New Pages: Creating a new non-draft page now triggers a clean, full rebuild to ensure it immediately appears in navigation and indexes.

Bug Fixes & Robustness

  • Theme & Template Loading: Fixed issues where theme CSS (style.css) and core structural templates (header.html, footer.html) weren't located correctly when using non-default THEMES_DIR or TEMPLATES_DIR settings (especially relevant for init-created sites). Themes now correctly control only styling, not core structure.
  • Secondary Page Index: Corrected a bug that caused pages.html to only list one page. Index generation is now reliable and includes caching for efficiency.
  • Tilde Expansion: Path variables in configuration using ~ (e.g., SRC_DIR="~/myblog/src") are now expanded more robustly.
  • Internal Refinements: Continued refactoring of internal scripts (post.sh, page.sh, edit.sh, etc.) to use configured variables consistently and rely on centrally loaded configuration, reducing redundancy. Fixed a syntax error in secondary page generation.

Important Update Notes

  • The new ./bssg.sh init command provides a better way to structure new BSSG sites going forward, separating site content from the BSSG application itself. Consider using this for future projects!
  • Be aware that the ./bssg.sh edit command now automatically updates the lastmod frontmatter field.
  • While this release focuses on new features and fixes, performing a clean rebuild after updating is always good practice to ensure all changes take effect correctly:
./bssg.sh build --clean-output --force-rebuild

Get the Update!

Update to BSSG 0.11.0 to benefit from site initialization, improved content management, workflow enhancements, and increased stability.

Happy blogging!

Stefano