This opens support for organising one's site in a way other than having
all markdown files under content/ and all non-markdown files under
static/. This is, in my opinion, a much nicer way to group pages and
the resources they need (images, videos, etc.) instead of having a big
static/img or static/assets directory.
Check the modified time of a given input file and the templates and only
build a page if one or more of those are newer than the already-built
output file.
This results in double-escaped content since lowdown(1) already
sufficiently escapes the HTML. Escaping was not actually necessary, and
the feed is valid without this.
Date is apparently extremely non-portable so limit its use to very
simple printing of current date/time plus timezone instead of trying to
use it to generate date strings.
There are two levels of verbosity: -v and -vv. The first prints out
command feedback where sbs would normally not print out anything and the
latter prints out each file as it is being built by the build
subcommand.
sbs has been modified to be silent by default as a result.
I'm moving away from Gemini and don't need this functionality anymore.
Plus, it would have been a bit of a pain to also add the functionality
for making a feed out of Gemini code so Gemini support would have
remained half-baked. A dedicated tool for Gemini is a better solution.
This stops the user from accidentally overwriting a file full of content
or resetting a website directory when using commands such as 'sbs new
page' or 'sbs new site'.
Previously, if you had a '/' or some other character recognized by sed
as a special regex character in the title or description of a page, that
page would fail to build. This adds a couple lines that runs those bits
of text through a separate sed command to escape any such special
characters and prevent those issues.
The title and description variables were not being unset before each
invocation of the build() function so pages would have incorrect titles
and descriptions, since those variables would only be set if they were
not already set (from a Gemini conversion).
If a gemini link points to a .jpeg, .jpg, or .png file, translate that
link into a Markdown-style image link (i.e. a link with a ! preceding
it) so that it will be compiled into an <img> tag for better viewing in
web browsers.
These changes allow one to build a page without having to go back up to
the root directory of the website. This should reduce deployment
friction when quickly iterating on a page or series of pages.
According to the gemtext specification, it's completely fine for there
to be zero or any number of spaces between the '=>' that denotes a link
and the following URL. This change allows that, instead of assuming
there will always be just one space after the '=>'.
Previously, if a Gemini link did not have a label, then sbs would skip
converting it to a Markdown-style link. For example:
=> /this/is/a/link.gmi
would not get converted whereas:
=> /this/is/a/link.gmi Link
would get converted. Since the label is optional according to the
gemtext specification, we need to support these situations.
If a link was something like:
=> git.gmi A Page About Git
Then sbs wouldn't convert the link to "git.html" since it was looking
for links that had a leading slash.
sbs can now convert gemtext to markdown which allows mixing gemini and
markdown in the same site directory and easy publishing of gemini
content for the web.
A modification of the build command was also added to allow building the
entire site without specifying any paths.