.Kind (page): .Type (posts) / .Layout ()
Bundle: n/a (regular page)
[ categories | tags | search ]
ox-hugo Test Site

This is the test site for the ox-hugo package for Emacs/Org-mode.

It is updated automatically after each commit to the ox-hugo repo. It was last updated on Jul 15, 2019 20:01 UTC.


This page was created/modified in commit dff9b47 "Replace external domain image links with local #test site" on 2018-05-03.
Markdown source of this page

Markdown source block with Hugo shortcodes

tags: src-block shortcode


Description/Summary

Shortcodes escaped The figure shortcodes in the two Markdown source code blocks below should not be expanded.. they should be visible verbatim. {{< .. >}} — Shortcodes without Markdown {{% .. %}} — Shortcodes with Markdown Code block using code fences {{< figure src="https://ox-hugo.scripter.co/test/images/org-mode-unicorn-logo.png" >}} {{% figure src="https://ox-hugo.scripter.co/test/images/org-mode-unicorn-logo.png" %}} Code block using highlight shortcode Here, the -n switch is added to the Org source block to auto-enable1 using the highlight shortcode.


Content

Shortcodes escaped

The figure shortcodes in the two Markdown source code blocks below should not be expanded.. they should be visible verbatim.

Code block using code fences

{{< figure src="https://ox-hugo.scripter.co/test/images/org-mode-unicorn-logo.png" >}}
{{% figure src="https://ox-hugo.scripter.co/test/images/org-mode-unicorn-logo.png" %}}

Code block using highlight shortcode

Here, the -n switch is added to the Org source block to auto-enable1 using the highlight shortcode.

1
2
{{< figure src="https://ox-hugo.scripter.co/test/images/org-mode-unicorn-logo.png" >}}
{{% figure src="https://ox-hugo.scripter.co/test/images/org-mode-unicorn-logo.png" %}}

Shortcodes not escaped

The figure shortcodes in the below example block should be expanded.. you should be seeing little unicorns below.

<figure> <img src="https://ox-hugo.scripter.co/test/images/org-mode-unicorn-logo.png"/> </figure>

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).


It is necessary to set the Hugo site config variable pygmentsCodeFences to true for syntax highlighting to work for fenced code blocks.


  1. Even if the user has set the HUGO_CODE_FENCE value to t (via variable, keyword or subtree property), the Hugo highlight shortcode will be used automatically instead of code fences if either (i) the user has chosen to either show the line numbers, or (ii) has chosen to highlight lines of code (See the ox-hugo documentation on Source Blocks). [return]

Page (Debug)

Page VariableValue
Name "Markdown source block with Hugo shortcodes"
Title "Markdown source block with Hugo shortcodes"
ResourceType "page"
Kind "page"
Section "posts"
Draft false
Type "posts"
Layout ""
Permalink "https://ox-hugo.scripter.co/test/posts/source-block-md-with-hugo-shortcodes/"
RelPermalink "/posts/source-block-md-with-hugo-shortcodes/"
Data
page.Data{} (type:page.Data)
NextPageMake the author front-matter plural
PrevPageMarkup Front-matter
NextInSectionMake the author front-matter plural
PrevInSectionMarkup Front-matter

Page Params (Debug)

KeyTypeValue
draftbool false
iscjklanguagebool false
lastmodtime.Time 2018-05-03 21:26:15 -0400 -0400
tags[]string "src-block" "shortcode"
titlestring "Markdown source block with Hugo shortcodes"

File Object (Debug)

FileInfo VariableValue
UniqueID "7920471648f1003dde3ab430a09700c0"
BaseFileName "source-block-md-with-hugo-shortcodes"
TranslationBaseName "source-block-md-with-hugo-shortcodes"
Lang "en"
Section "posts"
LogicalName "source-block-md-with-hugo-shortcodes.md"
Dir "posts/"
Ext "md"
Path "posts/source-block-md-with-hugo-shortcodes.md"

This site is generated using the ox-hugo package for Emacs/Org-mode + hugo-bare-min-theme + Hugo 0.56.0-DEV (commit 5eb33859, using Chroma commit 26f03cb) .
[Test Site home | ox-hugo home]