Hugo descriptions with ox-hugo

In a previous post, I explained how slugify this blog’s headings. Now, I’m going demonstrate how I do to insert front matter descriptions.

Currently, there are two ways to make ox-hugo insert a description attribute in a post’s front matter. The first method leverages the property EXPORT_HUGO_CUSTOM_FRONT_MATTER:

* Your cool title
# other props...
:EXPORT_HUGO_CUSTOM_FRONT_MATTER: :description Your cool description

Now, the one I use is made with the help of Org Mode’s Blocks.

* Your cool title
# other props...

Your cool description

By default, the easiest way to insert one is to run the press C-c C-, TAB description. However, this is keybinding sequence is quite long. In comparison, inserting a source block only requires C-c C-, s. So, why not have d as an option to select description? Here is how I did it.

I started by running C-h k (describe-key) and then C-c C-, to find out which command was associated with this keybinding. It turns out that it runs org-insert-structure-template, that selects a block from the variable org-structure-template-alist. Running C-c v (describe-variable) showed me the default value for this variable:

(("a" . "export ascii")
 ("c" . "center")
 ("C" . "comment")
 ("e" . "example")
 ("E" . "export")
 ("h" . "export html")
 ("l" . "export latex")
 ("q" . "quote")
 ("s" . "src")
 ("v" . "verse"))

Well, now it’s simply a matter of adding the ("d" . "description") value to the list and we should be good to go:

(add-to-list 'org-structure-template-alist '("d" . "description"))

Articles from blogs I follow around the net

The four tenets of SOA revisited

Twenty years after. In the January 2004 issue of MSDN Magazine you can find an article by Don Box titled A Guide to Developing and Running Connected Systems with Indigo. Buried within the (now dated) discussion of the technology…

via ploeh blog March 4, 2024

Building a demo of the Bleichenbacher RSA attack in Rust

Recently while reading Real-World Cryptography, I got nerd sniped1 by the mention of Bleichenbacher's attack on RSA. This is cool, how does it work? I had to understand, and to understand something, I usually have to build it. Well, friends, that is what…

via blog March 4, 2024

How to unbreak Dolphin on SteamOS after the QT6 update

A recent update to Dolphin made it switch to QT6. This makes it crash with this error or something like it: dolphin-emu: symbol lookup error: dolphin-emu: undefined symbol: _Zls6QDebugRK11QDockWidget, version Qt_6 This is fix…

via Xe Iaso's blog March 3, 2024

Generated by openring