Adds base URL support, permalink patterns, folder defaults, YAML/CSV data, taxonomies, excerpts, previous/next links, a new command, build --watch and live reload in serve. Sites built with 1.0.0 produce the same output unless they opt in; see Changed and Fixed below.
install-bx-module boxlang-ssg bx-yaml bx-markdown bx-jsoup
Added
baseUrl config key: a full URL (https://user.github.io/repo/) or a path prefix (/repo). prc.permalink, pagination hrefs and collection permalinks include the path prefix; prc.outFile does not. New prc.absoluteUrl (a front matter absoluteUrl still wins), derived config.pathPrefix and config.siteUrl (a site's own keys of those names are kept as written), and the template helpers relUrl() and absUrl(), which return an argument with a scheme, or starting with // or #, unchanged (a function of the same name in applicationHelper.bxm wins). A baseUrl starting with // is rejected. serve ignores baseUrl and previews at the root.
- Templates can read the loaded configuration as
config, including custom keys from ssg-config.json.
- Folder defaults:
_defaults.yml, _defaults.yaml or _defaults.json supplies front matter for every document in its folder and below.
_data/ also loads .yml, .yaml and .csv files. Two of these files for the same key fail the build; beside a .json file of the same key, one is skipped with a warning.
Full notes
permalinks config key: a URL pattern per document type, with the tokens :year, :month, :day, :slug, :name, :title and :dir. An explicit permalink still wins, and a pattern does not apply to index documents or the root 404 document.
taxonomies config key: group documents by other front matter keys in collections.taxonomies.<name>.terms and .byTerm. A site with a document type named taxonomies keeps collections.taxonomies as that type's collection until it configures taxonomies; with taxonomies configured, such a document fails the build.
prc.excerpt (front matter excerpt, the content before <!--more-->, or the first paragraph of a Markdown document) and prc.previous / prc.next within each type collection.
new <title> command with --type, --dir and --draft.
build --watch rebuilds whenever the source changes. Changing outputDir while build --watch or serve runs triggers one rebuild, not a rebuild loop.
serve reloads open pages in the browser after each rebuild; --no-reload turns it off.
- The starter has an Atom feed (
/feed.xml) and a sitemap (/sitemap.xml), links the feed from its layout, uses relUrl() for its own links so it works under a path prefix, shows excerpts on the home page and previous/next links on posts. Its site title, description and author moved from the layout's front matter to site in ssg-config.json, read as config.site.*.
Changed
- A file named
YYYY-MM-DD-name.md without date or publishDate takes its date from the file name; in 1.0.0 it fell back to the file's modified time. So a post (type: post) whose file name carries a future date and that has no date in front matter is now future-dated, and left out of the build unless --drafts; 1.0.0 published it. A date in a file name that is impossible or unparsable (0000-01-01-, 2026-13-01-) is ignored without a warning.
.yml, .yaml and .csv files in _data/ are now loaded into collections.global (1.0.0 ignored them), and a _defaults.yml, _defaults.yaml or _defaults.json file now applies to its folder.
- Data file keys:
.json files load exactly as in 1.0.0, so two .json files with the same key (x.json, x.backup.json) still build and the later one wins. A .yml, .yaml or .csv file with the same key as a .json file is skipped, so the output is unchanged, and the build prints a warning naming both files. Two .yml, .yaml or .csv files with the same key fail the build naming both.
- Existing custom keys named
baseUrl, permalinks or taxonomies in ssg-config.json are now validated and fail the build if they have the wrong shape. Custom siteUrl and pathPrefix keys are kept as written; config.siteUrl and config.pathPrefix show the values derived from baseUrl only when the file does not define them. __ssg is reserved for the generator.
- Render errors name the file that failed (the view or layout, not only the page) and end with
(line N) when BoxLang reports a line. An error in a view or layout says which page was being rendered (<file>: while rendering <page>: <message>) and is reported once per build instead of once per page.
Fixed
- A tag carried only by pages that pagination generates appeared in
collections.tags but got no tag page; pagination over collections.tags now covers it. Tags that come only from the pagination data itself may still be missed.