.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 Jun 26, 2022 21:18 UTC.

This page was created/modified in commit 9471c21 "fix: Don't introduce extra blank lines after list item paragraphs" on 2022-05-27.
Markdown source of this page

Indented source block

tags: indented lists code-fence src-block


Test that indented source blocks, and also the ones in lists export fine.


Some content.

(defun small-shell ()
  (other-window 1)
  (shrink-window (- (window-height) 12))

Code blocks in list using code fences #

Reference: hugo Issue #4006

(message "And now I am at level-0 indentation")

Code blocks in list using highlight shortcode #

Reference: hugo Issue #4717, ox-hugo Issue #161

Switched from exporting the highlight shortcode to exporting the code fenced blocks with attributes. These code fences are support by Hugo + Goldmark since v0.60.0.

Below notes are now outdated and thus grayed out.

This is an upstream bug in hugo as of 2018-05-12. The issue is that when the code blocks in highlight shortcodes are inserted at the required indentation levels in lists.. so that they get rendered in the list at that indentation level, those indentations are not removed by hugo, and thus become part of those code blocks.

Also, related to this issue, it can be seen that all such indented code blocks have an empty second line too, probably just due to the unremoved indentation on the last line of those code blocks.

In the above section, the same code blocks are code-fenced instead of using highlight shortcode, and the extra indentation is not seen there.

(message "And now I am at level-0 indentation")

Page (Debug)

Page VariableValue
Name "Indented source block"
Title "Indented source block"
ResourceType "page"
Kind "page"
Section "posts"
Draft false
Type "posts"
Layout ""
Permalink "https://ox-hugo.scripter.co/test/posts/source-block-indented/"
RelPermalink "/posts/source-block-indented/"
page.Data{} (type:page.Data)
NextPageIndented equations block
PrevPageInheriting tags
NextInSectionIndented equations block
PrevInSectionInheriting tags

Page Params (Debug)

descriptionstring " Test that indented source blocks, and also the ones in lists export\n fine.\n "
draftbool false
iscjklanguagebool false
lastmodtime.Time 2022-05-27 10:36:55 -0400 -0400
tags[]string "indented" "lists" "code-fence" "src-block"
titlestring "Indented source block"

File Object (Debug)

FileInfo VariableValue
UniqueID "fea1fa81e4c53d84cef5fc4eb01f2b40"
BaseFileName "source-block-indented"
TranslationBaseName "source-block-indented"
Lang "en"
Section "posts"
LogicalName "source-block-indented.md"
Dir "posts/"
Ext "md"
Path "posts/source-block-indented.md"

This site is generated using the ox-hugo package for Emacs/Org-mode + hugo-bare-min-theme + Hugo 0.101.0 (commit 466fa43c16709b4483689930a4f9ac8add5c9f66) . This site is powered by Netlify.
[Test Site home | ox-hugo home]