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

Announcing BSSG 0.41.0: Caching and Semantic Improvements

Published on: by Stefano Marinelli

3 min read

I am delighted to announce the release of BSSG version 0.41.0, in a warm Summer Sunday!

This release focuses on a few performance improvements and some semantic fixes, like adding canonical tags and several improvements on the RSS side.

I've added a few requested features, such as the ability to hide parts of the layout: the navigation menu in the header, the reading time on posts, the post descriptions on index pages. There's also a new control for automatically generating the excerpt from the content, when a post has no explicit description.

In 0.40.0 I'd introduced the fully in-RAM build mode, which in a great many scenarios noticeably improved generation times. With slow I/O or small sites, keeping everything in RAM means speed. But when you have very large sites, with hundreds of posts, things change: in RAM the operations are fast, but all the content gets regenerated, so hundreds of calls to the markdown processor, and so on. Caching was meant to help exactly here, but there were some nasty bugs that undermined its usability. It should now be far more stable and efficient: it even detects whether a post has been deleted, and rebuilds only and exclusively what concerns the posts that were added, modified or removed, along with their dependencies.

I've got further optimisations planned, but they'll require more substantial changes and a bit more testing.

Download, test and... write!

You can find the release files in the repo

Some info from the changelog:

Partial Changelog (v0.40.0 → v0.41.0)

New Features

  • BUILD_MODE server flag (scripts/bssg.sh) - bssg serve --build-mode ram|normal lets you switch build modes from the CLI without editing config
  • RSS image enclosures (scripts/build/generate_feeds.sh) - featured images are now attached as elements in RSS feeds with proper MIME type and file size
  • Canonical link tags added to all page types - post, page, archive, tag, author, and secondary pages all emit
  • twitter:card meta tag is now dynamically set - summary_large_image when a featured image is present, summary otherwise
  • Featured image preload () for LCP optimization on posts with images
  • fetchpriority="high" on post featured images (vs loading="lazy" on index/archive/tag thumbnails)

Configurable Display Options (config.sh) Four new settings (all default true for backward compatibility):

  • SHOW_HEADER_MENU Show/hide the navigation menu in the header
  • SHOW_INDEX_DESCRIPTIONS Show/hide post descriptions/excerpts on index pages
  • GENERATE_EXCERPT Auto-generate excerpt from content when no description is given
  • SHOW_READING_TIME Show/hide reading time on individual post pages

RSS Feed Improvements

  • RFC 822 GMT date formatting - new _rfc822_gmt_date() function produces proper GMT-based timestamps instead of timezone-offset strings, with caching for performance
  • _get_mime_type() helper for enclosure MIME detection
  • Tag RSS feeds also use the new RFC 822 date function

Caching & Rebuild Reliability

  • Post rebuild logic (generate_posts.sh) - replaced ad-hoc common_rebuild_check + mtime calls with unified file_needs_rebuild() (which already checked config/template/locale changes). Fixes edge cases where config changes didn't trigger post rebuilds
  • Archive month rebuild (generate_archives.sh) - when no per-file changes are detected, the system now checks BSSG_CONFIG_CHANGED_STATUS and template/locale timestamps to trigger a global archive rebuild. Previously, config changes could leave archive pages stale
  • Tag page rebuild (generate_tags.sh) - added BSSG_CONFIG_CHANGED_STATUS check to trigger regeneration when config changes
  • Archive diff comparison (indexing.sh) - now tracks title and description fields (cut fields 4 and 10) in addition to year/month/filename, so title/description changes trigger archive page rebuilds

Schema.org / Structured Data

  • Schema type changed from Article to BlogPosting for blog posts (more accurate)
  • Author email removed from JSON-LD (email no longer included unless explicitly provided)
  • datetime attributes in post meta now use ISO 8601 dates instead of display-format dates

Minor

  • VERSION file at repo root (currently 0.41) - version displayed in bssg.sh --help reads from this file
  • --build-mode documented in serve help output
  • New display config variables exported for parallel job workers (main.sh)
  • Consistently handles empty {{canonical}}, {{twitter_card}}, {{featured_image_preload}} placeholders across all page generators

Stefano