<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>weblog.masukomi.org - org-mode</title>
    <subtitle>Autistic, ADHD, Geek. The weblog of Kay Rhodes (masukomi).</subtitle>
    <link rel="self" type="application/atom+xml" href="https://weblog.masukomi.org/tags/org-mode/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://weblog.masukomi.org"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2025-12-30T09:14:44-05:00</updated>
    <id>https://weblog.masukomi.org/tags/org-mode/atom.xml</id>
    <entry xml:lang="en">
        <title>Using Org Mode With Hugo</title>
        <published>2024-07-19T00:00:00-04:00</published>
        <updated>2025-12-30T09:14:44-05:00</updated>
        
        <author>
          <name>
            masukomi
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://weblog.masukomi.org/2024/07/19/using-org-mode-with-hugo/"/>
        <id>https://weblog.masukomi.org/2024/07/19/using-org-mode-with-hugo/</id>
        
        <content type="html" xml:base="https://weblog.masukomi.org/2024/07/19/using-org-mode-with-hugo/">&lt;div class=&quot;ox-hugo-toc toc&quot;&gt;
&lt;div class=&quot;heading&quot;&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://weblog.masukomi.org/2024/07/19/using-org-mode-with-hugo/#overview&quot;&gt;Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://weblog.masukomi.org/2024/07/19/using-org-mode-with-hugo/#hugo-s-built-in-org-mode-support&quot;&gt;Hugo’s built-in org-mode support&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://weblog.masukomi.org/2024/07/19/using-org-mode-with-hugo/#ox-hugo&quot;&gt;Ox-Hugo&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://weblog.masukomi.org/2024/07/19/using-org-mode-with-hugo/#basic-usage&quot;&gt;Basic Usage&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://weblog.masukomi.org/2024/07/19/using-org-mode-with-hugo/#configuration&quot;&gt;Configuration&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://weblog.masukomi.org/2024/07/19/using-org-mode-with-hugo/#dot-dir-locals&quot;&gt;.dir-locals&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://weblog.masukomi.org/2024/07/19/using-org-mode-with-hugo/#keyword&quot;&gt;keyword&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://weblog.masukomi.org/2024/07/19/using-org-mode-with-hugo/#helpful-bits-and-info&quot;&gt;Helpful Bits &amp;amp; Info&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://weblog.masukomi.org/2024/07/19/using-org-mode-with-hugo/#where-the-post-goes&quot;&gt;Where the post goes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://weblog.masukomi.org/2024/07/19/using-org-mode-with-hugo/#frontmatter-helpers&quot;&gt;Frontmatter Helpers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://weblog.masukomi.org/2024/07/19/using-org-mode-with-hugo/#auto-generated-metadata&quot;&gt;Auto-generated metadata&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://weblog.masukomi.org/2024/07/19/using-org-mode-with-hugo/#image-and-alt-text&quot;&gt;Image &amp;amp; Alt Text&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://weblog.masukomi.org/2024/07/19/using-org-mode-with-hugo/#relative-link-helpers&quot;&gt;Relative Link Helpers&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://weblog.masukomi.org/2024/07/19/using-org-mode-with-hugo/#things-to-watch-out-for&quot;&gt;Things to watch out for&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://weblog.masukomi.org/2024/07/19/using-org-mode-with-hugo/#frontmatter&quot;&gt;Frontmatter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://weblog.masukomi.org/2024/07/19/using-org-mode-with-hugo/#shortcodes&quot;&gt;Shortcodes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://weblog.masukomi.org/2024/07/19/using-org-mode-with-hugo/#org-entities&quot;&gt;org-entities&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;h2 id=&quot;overview&quot;&gt;Overview&lt;/h2&gt;
&lt;p&gt;This post is for people who already understand why org-mode is the “greatest thing since sliced bread” &amp;amp; want to build a static web site with &lt;a rel=&quot;external&quot; href=&quot;https://gohugo.io/&quot;&gt;Hugo&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;hugo-s-built-in-org-mode-support&quot;&gt;Hugo’s built-in org-mode support&lt;/h2&gt;
&lt;p&gt;Hugo supports &lt;a rel=&quot;external&quot; href=&quot;https://orgmode.org/&quot;&gt;org-mode&lt;/a&gt; files by default thanks to the &lt;a rel=&quot;external&quot; href=&quot;https://github.com/niklasfasching/go-org&quot;&gt;go-org&lt;/a&gt; library. It will allow you to create blog posts with &lt;code&gt;.org&lt;/code&gt; files &lt;em&gt;and&lt;/em&gt; &lt;code&gt;.md&lt;/code&gt; files. &lt;em&gt;However&lt;/em&gt; I recommend that you &lt;em&gt;don’t&lt;/em&gt; use this option.&lt;/p&gt;
&lt;p&gt;go-org has the same problem that every non-Emacs implementation of org has. It doesn’t implement support for everything org-mode can do, and org-mode can do &lt;em&gt;a lot&lt;/em&gt;. It’s mostly good, but mostly only gets you &lt;em&gt;most&lt;/em&gt; of your needs, not &lt;em&gt;all&lt;/em&gt; of them. It’s one of those situations where it &lt;em&gt;seems&lt;/em&gt; good, until you start stumbling across little things that don’t work right or aren’t supported. The more you post, the more likely it is to frustrate you in the long run.&lt;/p&gt;
&lt;h2 id=&quot;ox-hugo&quot;&gt;Ox-Hugo&lt;/h2&gt;
&lt;p&gt;I recommend you us &lt;a rel=&quot;external&quot; href=&quot;https://ox-hugo.scripter.co/&quot;&gt;ox-hugo&lt;/a&gt;. It’s an excellent org-mode exporter that takes your org-mode file, converts it to Hugo friendly Markdown with TOML frontmatter. It can be configured to use YAML frontmatter but you’ll probably never look at the generated file so I don’t know why you would.&lt;/p&gt;
&lt;h3 id=&quot;basic-usage&quot;&gt;Basic Usage&lt;/h3&gt;
&lt;p&gt;The idea is pretty simple. You have some org-mode files of blog posts you’re working on. When you’re ready, you tell ox-hugo to export them, and it generates Hugo-friendly Markdown files.&lt;/p&gt;
&lt;p&gt;You can &lt;em&gt;also&lt;/em&gt; have it create a blog post from a “subtree” of an org-mode file. That is to say “This heading and everything under it should be a blog post”.&lt;/p&gt;
&lt;p&gt;You’ll want to keep your org-mode files in a directory &lt;em&gt;other&lt;/em&gt; than Hugo’s &lt;code&gt;content&lt;/code&gt; directory, because we don’t want it to even &lt;em&gt;think&lt;/em&gt; about your org-mode files. We only want it to consider the Markdown files we generate.&lt;/p&gt;
&lt;p&gt;At the root of my hugo site I have a &lt;code&gt;proto_posts&lt;/code&gt; directory where I create all my new blog posts. It doesn’t matter what you call it, and it doesn’t matter if you use a directory structure inside of it. It doesn’t even matter if you have it &lt;em&gt;in&lt;/em&gt; your hugo site. You could even keep all your writing in &lt;a rel=&quot;external&quot; href=&quot;https://protesilaos.com/emacs/denote&quot;&gt;Denote&lt;/a&gt; or &lt;a rel=&quot;external&quot; href=&quot;https://www.orgroam.com/&quot;&gt;Org-roam&lt;/a&gt; collections.&lt;/p&gt;
&lt;h3 id=&quot;configuration&quot;&gt;Configuration&lt;/h3&gt;
&lt;p&gt;Because the org-mode files could be literally anywhere on your computer, you need to tell &lt;code&gt;ox-hugo&lt;/code&gt; what directory to export to.&lt;/p&gt;
&lt;h4 id=&quot;dot-dir-locals&quot;&gt;.dir-locals&lt;/h4&gt;
&lt;p&gt;If you’re writing them to a directory within your hugo folder like I am, then you can add a &lt;code&gt;.dir-locals.el&lt;/code&gt; file at the root of your hugo folder with the following content.&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;emacs-lisp&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; .&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;org-hugo-base-dir &lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;~/path/to/weblog.masukomi.org/&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is an especially nice way of handling it if you’re managing multiple sites. Each one can have its own &lt;code&gt;.dir-locals.el&lt;/code&gt; file to make sure your &lt;code&gt;proto_posts&lt;/code&gt; always end up in the correct &lt;code&gt;content&lt;/code&gt; directory.&lt;/p&gt;
&lt;h4 id=&quot;keyword&quot;&gt;keyword&lt;/h4&gt;
&lt;p&gt;There are cases where using a &lt;code&gt;.dir-locals&lt;/code&gt; file isn’t an option. For example, you might use &lt;a rel=&quot;external&quot; href=&quot;https://protesilaos.com/emacs/denote&quot;&gt;Denote&lt;/a&gt; or &lt;a rel=&quot;external&quot; href=&quot;https://www.orgroam.com/&quot;&gt;Org-roam&lt;/a&gt; for all your writing and want to export to multiple blogs from that. In that case you’ll need to use a keyword in your org-mode metadata (frontmatter)&lt;/p&gt;
&lt;p&gt;&lt;code&gt;#+hugo_base_dir: ~/path/to/my/site&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&quot;helpful-bits-and-info&quot;&gt;Helpful Bits &amp;amp; Info&lt;/h3&gt;
&lt;h4 id=&quot;where-the-post-goes&quot;&gt;Where the post goes&lt;/h4&gt;
&lt;p&gt;Most hugo sites are broken up into “sections”. Typically it’s one collection of “pages” that live at the top level. Things like your “about” page. The files for these typically live under &lt;code&gt;content/&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Usually there’s a collection of “posts” too. The posts are what we’re typically interacting with when we visit a blog and these live under &lt;code&gt;content/post/&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;In order to control &lt;em&gt;where&lt;/em&gt; your exported file goes we use the &lt;code&gt;hugo_section keyword&lt;/code&gt;. &lt;em&gt;Most&lt;/em&gt; of the time you’ll be creating a post, so &lt;em&gt;most&lt;/em&gt; of the time it looks like this.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;#+hugo_section: post&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;But if you needed a file at the top level you’d use this&lt;/p&gt;
&lt;p&gt;&lt;code&gt;#+hugo_section: /&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;It can be any folder name or even subtrees like &lt;code&gt;post/journal/2024&lt;/code&gt; depending on the theme you’re using for your Hugo site.&lt;/p&gt;
&lt;h4 id=&quot;frontmatter-helpers&quot;&gt;Frontmatter Helpers&lt;/h4&gt;
&lt;p&gt;ox-hugo tries really hard to not interfere with common org-mode metadata keywords. The official ox-hugo keywords are &lt;a rel=&quot;external&quot; href=&quot;https://ox-hugo.scripter.co/doc/org-meta-data-to-hugo-front-matter/#for-file-based-exports&quot;&gt;listed here&lt;/a&gt;. In practice, I suspect that most people will have some form of auto-generated metadata like I show below, so it’s pretty rare that you’ll have to think about frontmatter.&lt;/p&gt;
&lt;p&gt;Fortunately for us ox-hugo’s creator gave emacs everything it’d need to populate the autocomplete with all the options. Just type &lt;code&gt;#+hugo_&lt;/code&gt; and look through the list.&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;/images/2024/07/19/hugo_frontmatter_helpers.png&quot; alt=&quot;a screenshot of the autocomplete menu shown after typing pound plus hugo underscore&quot; decoding=&quot;async&quot; loading=&quot;lazy&quot; /&gt;
&lt;/figure&gt;
&lt;h4 id=&quot;auto-generated-metadata&quot;&gt;Auto-generated metadata&lt;/h4&gt;
&lt;p&gt;Auto-generated metadata (frontmatter) is a massive time-saver. So the first thing I do when I open a new file for a blog post is to type &lt;code&gt;hfm&lt;/code&gt; to invoke my “Hugo FrontMatter” snippet (using &lt;a rel=&quot;external&quot; href=&quot;https://github.com/joaotavora/yasnippet&quot;&gt;YASnippet&lt;/a&gt; of course).&lt;/p&gt;
&lt;p&gt;This sets up all the frontmatter I need, &amp;amp; generates the date strings.&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# -*- mode: snippet -*-&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# name: hugo-frontmatter&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# key: hfm&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# --&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#+author: masukomi&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#+hugo_publishdate: `(format-time-string &amp;quot;%Y-%m-%dT%T%z&amp;quot;)`&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#+date: `(format-time-string &amp;quot;%Y-%m-%dT%T%z&amp;quot;)`&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#+hugo_auto_set_lastmod: t&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#+filetags: $1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#+toc: headlines 3&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#+hugo_draft: false&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#+hugo_section: ${2:posts}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#+hugo_custom_front_matter: :summary &amp;quot;I NEED A SUMMARY&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;!--list-separator--&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Things to note about that snippet&lt;/p&gt;
&lt;p&gt;There is no &lt;code&gt;#+title: …&lt;/code&gt; line. This is because my process is such that whenever I open a new &lt;code&gt;.org&lt;/code&gt; file for blogging it auto-populates with a name generated from the file name. If your process doesn’t do that, then add a &lt;code&gt;#+title: $1&lt;/code&gt; line above the &lt;code&gt;#+author&lt;/code&gt; line, and be sure to increment the numbers after &lt;code&gt;filetags&lt;/code&gt; and &lt;code&gt;hugo_section&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;For those who don’t know the dollar-sign numbers in YASnippet are essentially fields you fill in and tab to the next one. Your cursor will jump through them in numerical order starting with 1.&lt;/p&gt;
&lt;p&gt;I’ve set &lt;code&gt;hugo_draft&lt;/code&gt; to &lt;code&gt;false&lt;/code&gt; because of how I work.&lt;/p&gt;
&lt;p&gt;The other thing to note is the &lt;code&gt;#+toc: headlines 3&lt;/code&gt; This is for ox-hugo’s &lt;a rel=&quot;external&quot; href=&quot;https://ox-hugo.scripter.co/doc/org-toc/&quot;&gt;table of contents generation&lt;/a&gt; which is arguably superior to the TOC generation that Hugo has built in. If you don’t want a table of contents on your post, just delete that line.&lt;/p&gt;
&lt;p&gt;To be explicit, this is separate functionality from that provided by &lt;a rel=&quot;external&quot; href=&quot;https://github.com/snosov1/toc-org/tree/master&quot;&gt;toc-org&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;image-and-alt-text&quot;&gt;Image &amp;amp; Alt Text&lt;/h4&gt;
&lt;p&gt;All you need to do to insert an image is to create a &lt;code&gt;file:&lt;/code&gt; link to something with a common image file extension like &lt;code&gt;.jpg&lt;/code&gt; or &lt;code&gt;.png&lt;/code&gt;. It’ll just do the right thing.&lt;/p&gt;
&lt;p&gt;The problem with this is that it provides no alt-text for blind readers and you might want a descriptive title for the image.&lt;/p&gt;
&lt;p&gt;To address these we use the &lt;code&gt;ATTR_HTML&lt;/code&gt; keyword with &lt;code&gt;:alt&lt;/code&gt; or &lt;code&gt;:title&lt;/code&gt; respectively. These aren’t ox-hugo specific. They’re what you’d use if you had an org document that was going to ultimately be converted to HTML.&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#+ATTR_HTML: :alt a cute black and white puppy being cradled in my lap&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#+ATTR_HTML: :title our new puppy&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[[file:/images/path/to/puppy.jpg]]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That would get converted to:&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;{{&amp;lt; figure src=&amp;quot;/images/path/to/puppy.jpg&amp;quot; alt=&amp;quot;a cute black and white puppy being cradled in my lap&amp;quot; title=&amp;quot;our new puppy&amp;quot; &amp;gt;}}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;ox-hugo is using Hugo’s &lt;a rel=&quot;external&quot; href=&quot;https://gohugo.io/content-management/shortcodes/#figure&quot;&gt;figure shortcode&lt;/a&gt;, because Markdown doesn’t actually support alt tags, or titles&lt;/p&gt;
&lt;p&gt;Note that, just like in normal Hugo Markdown, the path you use needs to be the path that will work on the final generated site. For example: the images on this site are under &lt;code&gt;/images&lt;/code&gt; but in my hugo folder they’re under &lt;code&gt;static/images/&lt;/code&gt; Whenever I insert an image I have to use a &lt;code&gt;/images/…&lt;/code&gt; path to make it work in the final rendered site.&lt;/p&gt;
&lt;p&gt;I’m sure someone could combine some elisp and the &lt;code&gt;hugo_base_dir&lt;/code&gt; info to enable the images to be displayed inline but I don’t really care.&lt;/p&gt;
&lt;!--list-separator--&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;My Hugo Image Snippet&lt;/p&gt;
&lt;p&gt;I don’t like having to worry about unique image names. I always keep the images for a post in a dated folder that matches the post’s date. For example: this posts images are in a folder named &lt;code&gt;/images/2024/07/19/&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;When I want to insert an image into the page I type &lt;code&gt;himage&lt;/code&gt; to invoke the following snippet that generates the alt and title keywords + pre-populates the image url with a date based folder path.&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# -*- mode: snippet -*-&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# name: hugo-image&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# key: himage&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# --&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#+ATTR_HTML: :alt $2&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#+ATTR_HTML: :title&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[[file:`(format-time-string &amp;quot;/images/%Y/%m/%d/&amp;quot;)`$1]]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note that the cursor starts inside the link path because I’ve usually got the image filename on my clipboard. I can then just paste, &amp;amp; tab over to start writing the alt text.&lt;/p&gt;
&lt;p&gt;Most of the time I delete the title line.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;relative-link-helpers&quot;&gt;Relative Link Helpers&lt;/h4&gt;
&lt;p&gt;Cross-referencing other pages on your site is pretty common. The problem that Hugo is solving with &lt;a rel=&quot;external&quot; href=&quot;https://gohugo.io/content-management/cross-references/&quot;&gt;ref &amp;amp; relref shortcodes&lt;/a&gt; is that, without reading the frontmatter of the file you’re linking to, &amp;amp; pondering how Hugo will interpret it, you don’t know the final url of the page you’re linking to. For example: pages on this site are all prefaced with year, month, and date that the post was initially published, but that’s all calculated from the frontmatter during Hugo’s build process. All I know when writing is that it’s generated from a file called “my_relative_file.md” in the same &lt;code&gt;content/post/&lt;/code&gt; directory that the file I’m linking from will be in.&lt;/p&gt;
&lt;p&gt;Shortcode handling is a little problematic in ox-hugo. See &lt;a href=&quot;https://weblog.masukomi.org/2024/07/19/using-org-mode-with-hugo/#shortcodes&quot;&gt;Shortcodes&lt;/a&gt; below. To create a &lt;code&gt;relref&lt;/code&gt; link you’d have to write something like this.&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;@@hugo:[foo]({{&amp;lt; relref &amp;quot;my_relative_file.md&amp;quot; &amp;gt;}})@@&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;OR&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[foo](@@hugo:{{&amp;lt; relref &amp;quot;my_relative_file.md&amp;quot; &amp;gt;}}@@)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I don’t like having to type that obnoxious line and there’s a reasonable chance I’ll make a typo or misremember something when writing the filename.&lt;/p&gt;
&lt;p&gt;So, I’ve added a couple functions to &lt;a rel=&quot;external&quot; href=&quot;https://github.com/masukomi/masuconfigs/blob/master/.doom.d/config.org&quot;&gt;my emacs config&lt;/a&gt; to make inserting a &lt;code&gt;rel&lt;/code&gt; or &lt;code&gt;relref&lt;/code&gt; link work just like inserting any other link.&lt;/p&gt;
&lt;p&gt;Now I can&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;use &lt;code&gt;C-c l&lt;/code&gt; to insert a link&lt;/li&gt;
&lt;li&gt;choose or type &lt;code&gt;ref:&lt;/code&gt; or &lt;code&gt;relref:&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;hit return, and navigate to the path of the other file under hugo’s &lt;code&gt;content&lt;/code&gt; directory.&lt;/li&gt;
&lt;li&gt;select the file I want&lt;/li&gt;
&lt;li&gt;enter a description.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;When I export it will convert it to a markdown style link with the &lt;code&gt;ref&lt;/code&gt; / &lt;code&gt;relref&lt;/code&gt; shortcode for the url.&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;emacs-lisp&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;; New link type for Org-Hugo internal links&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;with-eval-after-load&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt; &amp;#39;&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;ox-hugo&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  (&lt;/span&gt;&lt;span&gt;org-link-set-parameters&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;   &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;relref&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   :&lt;/span&gt;&lt;span&gt;complete&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span class=&quot;z-l-3 z-l-b z-d-6 z-d-b&quot;&gt;lambda&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;               (&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;concat&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;                &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;relref:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                (&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;file-name-nondirectory&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;read-file-name&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;File: &lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                )&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;               )&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   :&lt;/span&gt;&lt;span&gt;export&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span class=&quot;z-l-3 z-l-b z-d-6 z-d-b&quot;&gt;lambda&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;path&lt;/span&gt;&lt;span&gt; description&lt;/span&gt;&lt;span&gt; backend&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;             (&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;format&lt;/span&gt;&lt;span&gt; &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;%s&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;]({{&amp;lt; relref &lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;%s&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; &amp;gt;}})&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span&gt; description path  &lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        )&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   )&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  (&lt;/span&gt;&lt;span&gt;org-link-set-parameters&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;   &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   :&lt;/span&gt;&lt;span&gt;complete&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span class=&quot;z-l-3 z-l-b z-d-6 z-d-b&quot;&gt;lambda&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;               (&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;concat&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;                &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;ref:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                (&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;file-name-nondirectory&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;read-file-name&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;File: &lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                )&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;               )&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   :&lt;/span&gt;&lt;span&gt;export&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span class=&quot;z-l-3 z-l-b z-d-6 z-d-b&quot;&gt;lambda&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;path&lt;/span&gt;&lt;span&gt; description&lt;/span&gt;&lt;span&gt; backend&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;             (&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;format&lt;/span&gt;&lt;span&gt; &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;%s&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;]({{&amp;lt; ref &lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;%s&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; &amp;gt;}})&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span&gt; description path  &lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        )&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   )&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note that there is no &lt;code&gt;:follow&lt;/code&gt; function set. Clicking on these links in org-mode won’t go anywhere. This is intentional because the link is going to the markdown file used when the site is generated, but I don’t know where the org-mode file used to generate that markdown file is, and &lt;em&gt;that&lt;/em&gt; is the file you’d want to open.&lt;/p&gt;
&lt;p&gt;I’ve considered changing &lt;code&gt;rel:&lt;/code&gt; &amp;amp; &lt;code&gt;relref:&lt;/code&gt; to &lt;code&gt;hugorel:&lt;/code&gt; &amp;amp; &lt;code&gt;hugorelref:&lt;/code&gt; but it’s not currently interfering with anything. If you do change it to something else be sure that the initial string and the text after &lt;code&gt;concat&lt;/code&gt; match each other.&lt;/p&gt;
&lt;h3 id=&quot;things-to-watch-out-for&quot;&gt;Things to watch out for&lt;/h3&gt;
&lt;h4 id=&quot;frontmatter&quot;&gt;Frontmatter&lt;/h4&gt;
&lt;p&gt;I expected that it’d just convert all the org-mode metadata / frontmatter, but it defaults to only converting a common subset of it, that it knows Hugo will want. &lt;a rel=&quot;external&quot; href=&quot;https://ox-hugo.scripter.co/doc/org-meta-data-to-hugo-front-matter/#for-file-based-exports&quot;&gt;Here’s a table documenting those&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I assume that the thinking is that org-mode files can have a lot of frontmatter that has nothing to do with your eventual blog-post.&lt;/p&gt;
&lt;p&gt;There are two ways to solve this. For most people who need a non-standard keyword you’ll just want to add this to your org mode frontmatter. You’d just change &lt;code&gt;:key&lt;/code&gt; and &lt;code&gt;&quot;value&quot;&lt;/code&gt; to whatever hugo frontmatter key &amp;amp; value you want.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;#+hugo_custom_front_matter: :key &quot;value&quot;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If you’re converting subtrees of a larger document into individual posts then you can use Properties. This is documented in the &lt;a rel=&quot;external&quot; href=&quot;https://ox-hugo.scripter.co/doc/org-meta-data-to-hugo-front-matter/&quot;&gt;Org meta-data to Hugo front-matter&lt;/a&gt; post.&lt;/p&gt;
&lt;!--list-separator--&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;summary keyword&lt;/p&gt;
&lt;p&gt;ox-hugo doesn’t pass on the &lt;code&gt;summary&lt;/code&gt; keyword which many Hugo themes use to display a short summary under your posts. Without this, most Hugo themes will just use the first bit of text in the post. If you use Tables of Contents, like I do in most of my posts, then that’s going to produce terrible summaries.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;!--list-separator--&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;tags&lt;/p&gt;
&lt;p&gt;offically you should use &lt;code&gt;#+hugo_tags: tag_a tag_b&lt;/code&gt; but I’ve been using &lt;code&gt;#+filetags&lt;/code&gt; and that converts just fine.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;shortcodes&quot;&gt;Shortcodes&lt;/h4&gt;
&lt;!--list-separator--&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Using Them&lt;/p&gt;
&lt;p&gt;ox-hugo is good, but Hugo’s shortcodes are a problem because &lt;code&gt;{{&amp;lt; … &amp;gt;}} and {{% … %}}&lt;/code&gt; are not legal Org syntax.&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-fn:1-1&quot;&gt;&lt;a href=&quot;https://weblog.masukomi.org/2024/07/19/using-org-mode-with-hugo/#fn-fn:1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;ox-hugo has &lt;a rel=&quot;external&quot; href=&quot;https://ox-hugo.scripter.co/doc/shortcodes&quot;&gt;multiple ways of addressing this&lt;/a&gt;. Most blog posts don’t really use shortcodes much. The most you’ll probably want on a semi-regular basis is something quick and inline rather than a multi-line block you can use these handy escapes.&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;@@hugo:..@@ &amp;lt;-- for Hugo templating stuff&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;@@md:..@@   &amp;lt;-- for raw Markdown stuff&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;@@html:..@@ &amp;lt;-- for raw HTML stuff&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For example, if I wanted to create a &lt;a rel=&quot;external&quot; href=&quot;https://gohugo.io/content-management/cross-references/&quot;&gt;relref&lt;/a&gt; link i could say&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;@@hugo:[foo]({{&amp;lt; relref &amp;quot;my_relative_file.md&amp;quot; &amp;gt;}})@@&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;OR&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[foo](@@hugo:{{&amp;lt; relref &amp;quot;my_relative_file.md&amp;quot; &amp;gt;}}@@)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Basically it’s saying “Just let hugo deal with whatever’s in here.”&lt;/p&gt;
&lt;p&gt;Because creating links to other posts on your site is a pretty common thing I’ve created a couple helper functions to make this less prone to typos &amp;amp; more natural feeling to org-mode users. See &lt;a href=&quot;https://weblog.masukomi.org/2024/07/19/using-org-mode-with-hugo/#relative-link-helpers&quot;&gt;Relative Link Helpers&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;!--list-separator--&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Blogging About Shortcodes&lt;/p&gt;
&lt;p&gt;Documenting the markup of a language without invoking the markup of the language is a pain in most (all?) markup languages. In this case we’re actually dealing with two layers of this. We don’t want to have the shortcodes invoked in the exported file, and we don’t want any org-mode syntax (like asterisks for bolding) to be invoked in the org-mode file.&lt;/p&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https://liatas.com/posts/escaping-hugo-shortcodes/&quot;&gt;Chris Liatas&lt;/a&gt; discovered the simple solution of sticking a comment inside the shortcode.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;figure&gt;&lt;img src=&quot;/images/2024/07/19/documenting_shortcodes.png&quot; alt=&quot;a screenshot showing how to insert a comment inside a shortcode in order to trick hugo into showing the shortcode and then how to trick org-mode into not using the asterisks in that comment as bolding indicators&quot; decoding=&quot;async&quot; loading=&quot;lazy&quot; /&gt;
&lt;/figure&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;So everywhere in this document where you see something like `{{&amp;lt; … &amp;gt;}}` or `{{% … %}}`&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;What I&amp;#39;ve actually typed in the original is two curlies, the `&amp;lt;` or `%`, then `/* … */`, and then the closing characters for the shortcode.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h4 id=&quot;org-entities&quot;&gt;org-entities&lt;/h4&gt;
&lt;p&gt;Org-mode has built in support for laTex style &lt;a rel=&quot;external&quot; href=&quot;https://orgmode.org/manual/Special-Symbols.html&quot;&gt;special characters&lt;/a&gt;. John Cook has a nice blog post that helps explain why these are potentially useful. As a simple example &lt;code&gt;\ast&lt;/code&gt; represents an asterisk.&lt;/p&gt;
&lt;p&gt;In writing this post I discovered that ox-hugo &lt;em&gt;does not&lt;/em&gt; convert them. So you end up with a literal &lt;code&gt;\ast&lt;/code&gt; in your markdown. I’ve &lt;a rel=&quot;external&quot; href=&quot;https://github.com/kaushalmodi/ox-hugo/issues/742&quot;&gt;filed a bug&lt;/a&gt; documenting the problem. If you’re reading at some point after July 2024, and want to use org-entities you should check the status of that ticket.&lt;/p&gt;
&lt;section class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-fn:1&quot;&gt;
&lt;p&gt;I don’t really understand why this is illegal syntax since org-mode doesn’t seem to complain when I enter them but it doesn’t really matter. What matters is that they give ox-hugo headaches. &lt;a href=&quot;https://weblog.masukomi.org/2024/07/19/using-org-mode-with-hugo/#fr-fn:1-1&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/section&gt;
</content>
        
    </entry>
</feed>
