Repository navigation
v1.1.0
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
baseUrlconfig 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.outFiledoes not. Newprc.absoluteUrl(a front matterabsoluteUrlstill wins), derivedconfig.pathPrefixandconfig.siteUrl(a site's own keys of those names are kept as written), and the template helpersrelUrl()andabsUrl(), which return an argument with a scheme, or starting with//or#, unchanged (a function of the same name inapplicationHelper.bxmwins). AbaseUrlstarting with//is rejected.serveignoresbaseUrland previews at the root.- Templates can read the loaded configuration as
config, including custom keys fromssg-config.json. - Folder defaults:
_defaults.yml,_defaults.yamlor_defaults.jsonsupplies front matter for every document in its folder and below. _data/also loads.yml,.yamland.csvfiles. Two of these files for the same key fail the build; beside a.jsonfile of the same key, one is skipped with a warning.permalinksconfig key: a URL pattern per document type, with the tokens:year,:month,:day,:slug,:name,:titleand:dir. An explicitpermalinkstill wins, and a pattern does not apply toindexdocuments or the root404document.taxonomiesconfig key: group documents by other front matter keys incollections.taxonomies.<name>.termsand.byTerm. A site with a document type namedtaxonomieskeepscollections.taxonomiesas that type's collection until it configurestaxonomies; with taxonomies configured, such a document fails the build.prc.excerpt(front matterexcerpt, the content before<!--more-->, or the first paragraph of a Markdown document) andprc.previous/prc.nextwithin each type collection.new <title>command with--type,--dirand--draft.build --watchrebuilds whenever the source changes. ChangingoutputDirwhilebuild --watchorserveruns triggers one rebuild, not a rebuild loop.servereloads open pages in the browser after each rebuild;--no-reloadturns it off.- The starter has an Atom feed (
/feed.xml) and a sitemap (/sitemap.xml), links the feed from its layout, usesrelUrl()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 tositeinssg-config.json, read asconfig.site.*.
Changed
- A file named
YYYY-MM-DD-name.mdwithoutdateorpublishDatetakes 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 nodatein 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,.yamland.csvfiles in_data/are now loaded intocollections.global(1.0.0 ignored them), and a_defaults.yml,_defaults.yamlor_defaults.jsonfile now applies to its folder.- Data file keys:
.jsonfiles load exactly as in 1.0.0, so two.jsonfiles with the same key (x.json,x.backup.json) still build and the later one wins. A.yml,.yamlor.csvfile with the same key as a.jsonfile is skipped, so the output is unchanged, and the build prints a warning naming both files. Two.yml,.yamlor.csvfiles with the same key fail the build naming both. - Existing custom keys named
baseUrl,permalinksortaxonomiesinssg-config.jsonare now validated and fail the build if they have the wrong shape. CustomsiteUrlandpathPrefixkeys are kept as written;config.siteUrlandconfig.pathPrefixshow the values derived frombaseUrlonly when the file does not define them.__ssgis 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.tagsbut got no tag page; pagination overcollections.tagsnow covers it. Tags that come only from the pagination data itself may still be missed.