;; Follow Hugo links(defunorg-hugo-follow(link)"Follow Hugo link shortcodes"(org-link-open-as-file(string-trim"{{% ref test.org %}}""{{% ref ""%}}")));; New link type for Org-Hugo internal links(org-link-set-parameters"hugo":complete(lambda()(concat"{{% ref */"(file-name-nondirectory(read-file-name"File: "))" %}}")):follow#'org-hugo-follow)
The figure shortcode in the below example block should be
expanded.. you should be seeing a little unicorn below.
Above a #+begin_example .. #+end_example block is chosen
arbitrarily. The Hugo shortcodes will remain unescaped in any
source/example block except for Markdown source blocks (annotated
with md language).
Below, the same figure shortcode is called with the % syntax.
Note
If you are using Hugo 0.55.0 or newer, you will just see the
raw HTML from this shortcode (unrendered HTML) because the behavior
of {{% .. %}} shortcodes changed in Hugo v0.55.0.
It is necessary to set the Hugo site config variable
markup.highlight.codeFences to true (default) for syntax
highlighting to work for fenced code blocks.