boxlang-ssg 1.0.0

Released .

First release as an installable BoxLang module.

install-bx-module boxlang-ssg bx-yaml bx-markdown bx-jsoup
boxlang module:ssg init my-site
  • Output paths changed to folder-style URLs: posts/x.html is now posts/x/index.html (URL /posts/x/), so sites work on any static host. router.bxs was removed.
  • boxlang-ssg is now a BoxLang module, installed once and run from any site folder with boxlang module:ssg <command>. New commands: init, serve, list, clean; new flags: --source, --verbose, --drafts, --port. Exit codes: 0 success, 1 usage error, 2 build failure.
  • setup.bx and requirements.txt were removed. bx-yaml, bx-markdown and bx-jsoup are declared as dependencies in box.json with caret ranges. install-bx-module does not install declared dependencies, so the install command names them; box install boxlang-ssg (CommandBox) does install them. build and serve check for the three modules at startup and print the install command if one is missing.

Fixed

  • Builds failed on BoxLang 1.19 because templates were included by absolute path; site templates are now included through an application mapping.
  • Exceptions are no longer swallowed: a page that fails to render is not written, every failure is reported as file: message, and the build exits 2. The error(), print.greyline(), dump() and abort calls are gone.
  • Pagination wrote page 1 of permalink: /jokes/page/{{page}}/index.html to /jokes/page/index.html/index.html; every page now substitutes its number, and paginationInfo.href values point at files that exist.
  • Paginated pages respect excludeFromCollections in type collections as well as all, and type keys are lower-cased consistently.
  • Discovery matches .md and .bxm by extension rather than by substring, and always skips _includes/, _data/, the output folder, dot-folders at any depth, boxlang_modules/ and node_modules/. Only the root README.md is skipped by default.
  • Front matter without a closing marker, or .md front matter that is not valid YAML, fails the build naming the file; an empty tags: no longer throws.
  • Posts sort newest first by date, then publishDate, then file modified time, without throwing when dates are missing. Future-dated posts are treated as drafts unless --drafts.
  • Tag permalinks use the slugified tag, and the starter links to the URL the tag page is written to.
  • The starter layout uses the page's title and description, falling back to the site values.
  • ssg-config.json is merged over defaults and validated; outputDir must be inside the site root and not the site root itself.
  • bx-markdown is no longer pinned to an exact version.
  • pagination.data resolves against collections only, and a path that does not exist fails the build instead of being created silently.
  • An explicit permalink on a type: post document was ignored when choosing the output file; an explicit permalink now wins for every type.
  • collections.tags and collections.byTag are built in one place from every document with tags that is not excluded from collections.
  • An empty front matter value such as title: left the key null on BoxLang without bx-compat-cfml; it now falls back to the default.
  • The starter's post date and stylesheet cache-buster used CFML date masks (mmm, yyyy-mm-dd), which fail or print minutes on BoxLang without bx-compat-cfml; they now use MMM and yyyy-MM-dd.

Changed

  • collections.tags is now sorted case-insensitively.
  • Generated pagination pages now take part in type and tag collections and honour excludeFromCollections.
  • A paginated template with no explicit permalink bases its pages on its own resolved permalink; size: 1 without a placeholder writes page/<n>/ instead of overwriting one file.
  • minify and tidyHtml apply to HTML output only (previously minify also touched non-HTML output such as XML feeds).
  • Front matter must start on the first line of the file.
  • In .bxm files a leading comment that is not a YAML mapping is treated as an ordinary comment with a warning.
  • Two documents that resolve to the same output file, a missing passthru entry, invalid config, and front matter/pagination/render errors now fail the build with exit code 2 instead of being skipped silently.
  • Bootstrap JS, jQuery and Popper removed from the starter layout.
  • prc.inFile and prc.outFile are now paths relative to the site root and the output folder (they were absolute paths), and prc.date is always a date object.
  • A passthru entry that is empty, ., an absolute path or contains .. now fails the build; entries must be paths inside the site root.
  • serve uses a web server built into the module and no longer needs boxlang-miniserver. It listens on 127.0.0.1 only, so the site is reachable from your own machine alone, and it answers a missing page with the site's 404.html.