Skip to content

Releases: tdemin/gmnhg

v0.4.2

19 Mar 07:46
v0.4.2
5f755e4
Compare
Choose a tag to compare

This is a minor bugfix release which only fixes one thing:

  • Link URIs are now properly encoded before rendering in Gemtext, preventing problems on spaces in paths and so on (#49).

v0.4.1

02 Jan 09:11
v0.4.1
62d762a
Compare
Choose a tag to compare

This is a minor bugfix release which fixes two small things:

  • Non-Latin characters in file paths are now allowed (#48);
  • .Metadata is now passed to directory and top-level index pages, allowing users to render their front matter data in index templates (#47).

v0.4.0

03 Oct 06:27
v0.4.0
ddb3943
Compare
Choose a tag to compare

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 the gmnhg.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 to rss.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 (the WithMetadata flag is now also gone);
  • all of its metadata code has moved to internal/gmnhg, as this code was only used by md2gmn in an improper way anyways.

v0.3.0

03 Sep 17:05
v0.3.0
bcc3d8b
Compare
Choose a tag to compare

This release brings a number of major improvements and bug fixes to the renderer, making it much more predictable. The renderer now supports footnotes, links-only lists, preformatted text comments, definition lists, horizontal rules, and subscript / superscript (the last three being a lossy conversion into plaintext). It will now recursively detect and render links in any block, including blockquotes, paragraphs, lists, footnotes, and tables.

A number of tweaks has also been made to how the renderer processes text:

  • gmnhg will now split links blocks into three distinct blocks: footnotes, images, and links, the three separated by a single newline. This groups distinct content entities, helping readability of the resulting text.
  • Blocks of distinct types coming right after another block with no preceding newline will now get parsed as new blocks, and not continuations of the preceding blocks (the latter being gomarkdown default). This allows you to put a Markdown list right after a paragraph with no extra newline, and have it treated as a list. Despite the lack of newline, gmnhg will still insert one.
  • Bits of formatting supported by Markdown but unsupported in Gemtext will now be rendered in plain text (for instance, bold text will be enclosed in double asterisks, and footnotes will be displayed as [^1] and etc). While they will get disregarded by most Gemini clients, they allow the reader to still have the stylistic context that would have been otherwise lost.
  • gmnhg will now render plain text in various contexts the exact same way, differing only in newline usage. This also fixes some minor bugs like panicking on links in headings.

gmnhg now supports sprig v3 tags in templates, making them more useful overall, and adds two new tags:

  • sort, which sorts anything implementing sort.Sort (including lists of posts) in ascending order;
  • sortRev, which works like sort, but in reverse order.

The older function sortPosts is now an alias to sortRev.

gmnhg from now on also supports Hugo page bundles (essentially directories of pages and related resources). For details on what these are and how to use them, see 1.

The library itself has changed the numeric values of the configurable renderer flags bitmask to make the Go compiler automatically calculate flag values. While this shouldn't be an issue to the correct code utilizing gmnhg as a library, this is still a breaking change.

v0.2.0

13 Aug 17:50
v0.2.0
aadb650
Compare
Choose a tag to compare

This release brings Markdown table support to the renderer, displayed in Gemtext as preformatted text. Aside from that, it also fixes a few bugs, such as gmnhg disallowing YAML/JSON Hugo configs, panicking on empty blockquotes, and handling heading levels 4-6 against the Gemini specification.

v0.1.2

31 Jul 23:20
v0.1.2
2ea0b7d
Compare
Choose a tag to compare

Updates Go to 1.16 and makes gmnhg Docker image available to everyone through GitHub container registry as ghcr.io/tdemin/gmnhg. The Docker image is useful in compiling Hugo sites in CI pipelines, etc.