.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 Mar 05, 2024 19:24 UTC.


This page was created/modified in commit 451d617 "Replace "--" with "-" in export Markdown files" on 2022-01-16.
Markdown source of this page

No TOC in Summary (without more comment marker)

tags: export-option toc summary endtoc


Description/Summary

By default, Hugo will dump everything at the beginning of a post into its .Summary (See Hugo content summaries). As TOC enabled using the export option like toc:t is inserted at the beginning of a post, TOC will be shown in that summary too!

In this example, the special comment more is not used. …


Content

Table of Contents

By default, Hugo will dump everything at the beginning of a post into its .Summary (See Hugo content summaries). As TOC enabled using the export option like toc:t is inserted at the beginning of a post, TOC will be shown in that summary too!

In this example, the special comment more is not used.

ox-hugo’s Solution #

ox-hugo helps prevent that with a workaround.. it inserts a special HTML comment <!--endtoc--> after the TOC.

Snippet #

As the more comment is not present, the summary_minus_toc.html partial used for this test site ensures that only the first 300 (or so) characters after <!--endtoc--> is considered as summary.

This partial needs to be used wherever the summary text is needed (example: the Opengraph og:description meta tag).


Page (Debug)

Page VariableValue
Name "No TOC in Summary (without more comment marker)"
Title "No TOC in Summary (without more comment marker)"
ResourceType "page"
Kind "page"
Section "posts"
Draft false
Type "posts"
Layout ""
Permalink "https://ox-hugo.scripter.co/test/posts/no-toc-in-summary-without-more/"
RelPermalink "/posts/no-toc-in-summary-without-more/"
Data
page.Data{} (type:page.Data)
NextPageNo TOC in Summary (with more comment marker)
PrevPageNumber 0 levels
NextInSectionNo TOC in Summary (with more comment marker)
PrevInSectionNumber 0 levels

Page Params (Debug)

KeyTypeValue
draftbool false
iscjklanguagebool false
lastmodtime.Time 2022-01-16 11:59:06 -0500 -0500
tags[]string "export-option" "toc" "summary" "endtoc"
titlestring "No TOC in Summary (without more comment marker)"

File Object (Debug)

FileInfo VariableValue
UniqueID "6594a46272d8639a10f77f8f27e4b986"
BaseFileName "no-toc-in-summary-without-more"
TranslationBaseName "no-toc-in-summary-without-more"
Lang "en"
Section "posts"
LogicalName "no-toc-in-summary-without-more.md"
Dir "posts/"
Ext "md"
Path "posts/no-toc-in-summary-without-more.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]