v0.4.0
This release focuses on the improvements to cmd/gmnhg and is largely formed thanks to @mntn-xyz. Overall, it makes gmnhg usable out of the box to get a reasonable Gemini site with zero additional configuration.
- gmnhg now renders RSS timelines for the entire site as an
rss.xml
file inside content directories. As these require an absolute URI, you need to set thegmnhg.baseURL
setting inside Hugo configuration file (config.toml/yaml/json
). RSS timelines can be overwritten on a per-directory/site-wide basis; see godoc on how to do that. As there's no standard RSS discovery method in Gemini, the users are expected to put a link torss.xml
on their site where necessary. - gmnhg will now parse metadata in TOML, JSON, and Org formats as well as YAML, adhering to the same rules of parsing as Hugo does.
- Index/page templates now receive a unified set of metadata properties, making the top-level
_index.gmi.md
receive.Posts
instead of.PostData
, and pages receive.Title/.Date/.Summary
instead of.PostTitle/.PostDate/.PostSummary
(a breaking change). - Templates themselves are cleaned up so a working site can be set up with zero additional adaptations.
The renderer is now capable of properly stripping HTML (fixing a long-standing issue #6 where HTML tags wouldn't be stripped when they occupied the entire paragraph or belonged to a blockquote) in any scenario. The contents of the tag are still kept, aside from tags unlikely to ever contain meaningful content (such as script
, iframe
, style
, etc).
The renderer now simply prints Markdown H4-H6 without appending an additional space. It used to be mandatory in older versions of the Gemini specification, but it is now optional (while some older Gemtext FAQs still say it isn't).
As part of the library changes, md2gmn
will no longer print any post metadata, instead simply stripping it from the output; see below for the reasons to do so.
gmnhg the library has received a major refactoring too, with some breaking changes:
- it now has a proper test coverage (tested on files in
testdata
); RenderMarkdown
signature has changed to no longer provide metadata (theWithMetadata
flag is now also gone);- all of its metadata code has moved to
internal/gmnhg
, as this code was only used bymd2gmn
in an improper way anyways.