• 0.12.1 9976dfdf3f

    stefano released this 2025-04-16 09:16:10 +02:00 | 62 commits to main since this release

    Key Highlights in 0.12.1

    This release focuses heavily on automation, flexibility, and convenience:

    1. Powerful Build-Time Configuration Overrides

    You now have fine-grained control over your build process directly from the command line, without needing to edit configuration files for temporary changes or specific scenarios. The ./bssg.sh build command accepts numerous new arguments to override settings:

    • Core Paths: --config, --local-config, --src, --output, --templates, --theme, --static, --pages, --drafts, --themes-dir
    • Site Metadata: --site-title, --site-url, --site-description, --author-name, --author-email
    • Build Options: --posts-per-page, --clean-output, --force-rebuild

    Example: Test a build with a different output directory:

    ./bssg.sh build --output /tmp/bssg-test
    

    This is fantastic for scripting, CI/CD pipelines, or simply testing variations quickly.

    2. Create Posts Entirely from the Command Line

    The ./bssg.sh post command has been supercharged! You can now create new posts completely non-interactively, specifying details via options:

    • -t "<title>": Set the post title.
    • -T <tag1,tag2>: Assign tags (comma-separated).
    • -s <custom-slug>: Specify a custom slug.
    • -c "<content>": Provide post content directly as a string.
    • -f <filepath>: Use content from a file.
    • --stdin: Read post content from standard input.
    • --html: Create the post with an .html extension (instead of .md).
    • -d: Create the post in the drafts directory.

    You can even force a rebuild immediately after creation, even if REBUILD_AFTER_POST is false in your config, using the --build flag:

    echo "My quick post content." | ./bssg.sh post -t "Quick Update" -T announcement --stdin --build
    

    This opens up exciting possibilities for automated content generation or integration with other tools.

    3. Integrated Deployment Hooks

    Bridge the gap between building and deploying your site! BSSG now includes configuration options to automatically trigger your deployment process:

    • DEPLOY_AFTER_BUILD="true": Set this in your config to run the deployment script after every successful build.
    • DEPLOY_SCRIPT="/path/to/your/deploy.sh": Specify the script to execute.

    You can also override this behavior for specific builds using command-line flags:

    • ./bssg.sh build --deploy: Force deployment even if DEPLOY_AFTER_BUILD is false.
    • ./bssg.sh build --no-deploy: Prevent deployment even if DEPLOY_AFTER_BUILD is true.

    Streamline your publishing workflow with this simple yet powerful integration.

    4. Optional Per-Tag RSS Feeds

    As previewed recently in the main branch, you can now enable the generation of separate RSS feeds for each tag on your site. This allows your readers to subscribe specifically to the topics they care about most.

    • Enable via ENABLE_TAG_RSS="true" in your configuration (defaults to false).
    • Feeds are generated at ${OUTPUT_DIR}/tags/<tag_slug>/rss.xml.
    • Auto-discovery links are automatically added to tag pages.

    5. Bug Fixes

    This release also incorporates several bug fixes identified since 0.11.0, enhancing the overall stability and reliability of BSSG. Particular attention has been paid to improving the backup and restore procedures.

    Important Update Notes

    While this release primarily adds new features and options, the scope of changes (especially around build overrides and deployment hooks) is significant. To ensure all new functionalities work correctly and integrate smoothly with your setup, performing a clean rebuild after updating is recommended:

    ./bssg.sh build --clean-output --force-rebuild
    

    Review the new configuration options (ENABLE_TAG_RSS, DEPLOY_AFTER_BUILD, DEPLOY_SCRIPT) and consider how they might benefit your workflow.

    Downloads
  • 0.11.0 e8538f872f

    stefano released this 2025-04-14 10:45:22 +02:00 | 73 commits to main since this release

    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.

    Downloads
  • 0.10.0 a15ae91fe1

    stefano released this 2025-04-13 13:07:46 +02:00 | 84 commits to main since this release

    Key Highlights in 0.10.0

    Enhanced Configuration

    I've added several new variables to config.sh to give you more control over your site's behavior:

    • RSS_ITEM_LIMIT: Customize the number of posts included in your RSS feed (defaults to 15).
    • SHOW_TIMEZONE: Choose whether to display timezone offsets alongside dates throughout your site (defaults to false).
    • REBUILD_AFTER_POST & REBUILD_AFTER_EDIT: Decide if the site should automatically rebuild after creating or editing posts using the ./bssg.sh post and ./bssg.sh edit commands (defaults to true).

    Improved Post Management

    • lastmod Frontmatter: You can now add an optional lastmod field to your post's frontmatter. This allows you to specify a modification date separate from the original publish date. This modification date will be used in your sitemap.xml and RSS feed (<atom:updated>). If the lastmod date differs from the date, an "Updated on" notice will also appear on the post page itself.

    User Experience Touches

    • "Back to Top" Link: A localized "Back to Top" link has been added to the footer for easier navigation on long pages.
    • Minimal Theme Enhancements: The included minimal theme has received visual tweaks and improvements for a cleaner look.
    • Editor Fallback Easter Egg: If the EDITOR environment variable isn't set and nano isn't available, BSSG will now fall back to using vi. As a small helper, if vi is used as the fallback, the post and edit scripts will provide instructions on how to save and exit vi.

    Internal Refinements

    • Build Process Refactoring: The internal build logic has been reorganized from a single script (scripts/build.sh) into multiple focused scripts within the scripts/build/ directory. While this is an internal change aimed at improving efficiency and output quality, it represents a significant shift in the build process structure. Don't worry, the user-facing command ./bssg.sh build remains exactly the same!

    Important Update Notes

    While the main ./bssg.sh build command functions as before, the internal refactoring mentioned above is a significant change. If you have custom scripts that interacted with the old scripts/build.sh (like potentially generate_theme_previews.sh if customized) or have heavily modified theme templates (like the footer), please review them carefully after updating to ensure they still work as expected with the new build structure in the scripts/build/ directory.

    To ensure a smooth transition and avoid potential issues from leftover files, I strongly recommend performing a clean rebuild after updating:

    ./bssg.sh build --clean-output --force-rebuild
    
    Downloads
  • 0.9.2 448559d41b

    stefano released this 2025-04-08 22:16:49 +02:00 | 91 commits to main since this release

    • Older/Newer for page navigation were inverted
    • reader-mode theme had some problems with images, now fixed
    Downloads
  • 0.9.1 ec16ff9add

    stefano released this 2025-04-08 21:21:27 +02:00 | 92 commits to main since this release

    Fixed

    • Sitemap (sitemap.xml) now includes entries for pages defined in the $PAGES_DIR.
    • Sitemap uses the article's frontmatter date (YYYY-MM-DD) for the <lastmod> tag for posts, instead of the file modification time. Tags and archives still use file modification time. Index pages use build time.
    • RSS feed (rss.xml) now correctly uses the article's frontmatter date for <pubDate>. If the frontmatter date lacks a time component, it defaults to midnight (00:00:00) of that date, rather than using the build time.
    Downloads
  • 0.9 eea95a6991

    stefano released this 2025-04-06 19:37:54 +02:00 | 93 commits to main since this release

    This marks the first public release of BSSG - Bash Static Site Generator (v0.9)!

    After nearly a decade of personal development and use, stemming from a journey away from complex dynamic CMS platforms like WordPress, BSSG is now available for everyone. It represents a desire for a simpler, more portable, and owner-controlled way to manage personal blogs and websites.

    Read the full story behind its creation here: Launching BSSG - My Journey from Dynamic CMS to Bash Static Site Generator

    What is BSSG?

    BSSG is a static site generator written entirely in Bash script. It takes Markdown files (with simple frontmatter) for posts and pages and generates a complete, static HTML website. It's designed with portability and simplicity in mind, aiming to be a robust alternative for blogs where content doesn't change every second.

    Key Features in this Release:

    • Portability: Designed to run on Linux, FreeBSD, OpenBSD, NetBSD, and macOS with minimal dependencies (Bash, standard Unix utils, a Markdown processor).
    • Markdown Support: Uses Pandoc, CommonMark (cmark), or markdown.pl for processing content.
    • Essential Blogging Features: Generates RSS feeds, sitemap.xml, tag pages, yearly/monthly archives, OpenGraph tags, and calculates reading times.
    • Simple Theming: Easily switch themes by changing a CSS file. Over 50 diverse themes included (from modern to retro-computing styles)! Includes a script (generate_theme_previews.sh) to preview your site with all themes.
    • Performance: Includes incremental builds, metadata caching, and optional parallel build support via GNU parallel to handle larger sites efficiently.
    • Utilities: Built-in backup and restore scripts for easy content management.
    • Internationalization (i18n): Supports generating the site in different languages (site-wide, not multilingual posts yet).
    • Customization: Configurable slugs, posts per page, date formats, timezones, and more via config.sh.local.
    • Static Files & Pages: Easily include static assets (images, CSS, JS) and create static pages alongside blog posts.
    • BSD Licensed: Freedom to use and modify.

    Why v0.9?

    While BSSG is stable and has been used personally and by some clients for years, this initial public release acknowledges that the codebase (especially build.sh) grew organically and could benefit from refactoring. Future releases will focus on code cleanup, potential new features (like lastmod timestamps), and addressing any issues found by the community. The core functionality should be solid and ready for use.

    (Note: An experimental Node.js admin interface exists but is not included in this core release bundle as it requires further testing.)

    Getting Started:

    1. Clone the repository.
    2. Install dependencies (usually just bash and cmark or pandoc).
    3. Run ./bssg.sh post to create your first post.
    4. Run ./bssg.sh build to generate your site in the output/ directory.
    5. Check the README.md for full details.

    I hope BSSG proves useful for those seeking a straightforward, shell-based approach to static site generation.

    Happy Blogging!

    Downloads