Skip to content

Releases: maelvls/hudevto

0.2.0

22 Feb 16:15
b9e5171
Compare
Choose a tag to compare

Changes since 0.1.0

Anchor IDs in links are now converted

Anchor links are now converted from the Hugo format to the Devto syntax. For context, Devto and Hugo produce slightly different anchor IDs. Let us consider the following Markdown snippet in which we refer to a heading using an anchor. The anchor's syntax that Hugo uses is the same in GitHub-flavoured Markdown:

## Docker and the `HTTPS_PROXY` variable

produces:

<h2 id="docker-and-the-https-proxy-variable">Docker and the <code>HTTPS_PROXY</code> variable</h2>

In Devto, the anchors that get generated are different:

<h2 id="docker-and-the-raw-httpsproxy-endraw-variable">Docker and the <code>HTTPS_PROXY</code> variable</h2>

In order to "translate" from the Hugo syntax to the Devto syntax, the page is parsed another time (Hugo already parsed it) so that we can list the headings and do a mapping between the Hugo anchors and the Devto anchors. The above example should now look like this: If an anchor isn't found in the document, you will now be warned.

<img> tags are now "absolulified"

In the previous version, the images were already converted so that Devto can use them. Since you can also embed <img> tags in markdown, these are also converted. More precisely, the "base path" is added to the src URL so that Devto can find the image.

For example:

<img src="dnat-google-vpc-how-comes-back.svg"/>

is now converted to:

<img src="https://maelvls.dev/you-should-write-comments/dnat-google-vpc-how-comes-back.svg"/>

Fix a problem with fetching unpublished articles

A while back, Devto used to return the unpublished articles with the endpoint GET /articles/:id. I switched from using that endpoint to GET /articles/me/published and GET /articles/me/unpublished.

Proper help command (hudevto help)

The help command is now much more helpful and opens in a pager (same behavior as git help):

Screenshot 2023-02-22 at 17 13 38