-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix exporting #+toc keyword with 'local'
Fixes #183.
- Loading branch information
1 parent
850c10d
commit 03fe85a
Showing
3 changed files
with
155 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
+++ | ||
title = "TOC Local" | ||
tags = ["keyword", "toc", "local"] | ||
draft = false | ||
+++ | ||
|
||
Below, TOC is exported with only level-1 headings in this post. | ||
|
||
<div class="ox-hugo-toc toc"> | ||
<div></div> | ||
|
||
<div class="heading">Table of Contents</div> | ||
|
||
- [Post sub-heading 1](#post-sub-heading-1) | ||
- [Post sub-heading 2](#post-sub-heading-2) | ||
- [Post sub-heading 3](#post-sub-heading-3) | ||
|
||
</div> | ||
<!--endtoc--> | ||
|
||
|
||
## Post sub-heading 1 {#post-sub-heading-1} | ||
|
||
Below, TOC is exported with only level-1 headings **relative to** this | ||
"Post sub-heading 1" section. | ||
|
||
<div class="ox-hugo-toc toc local level-2"> | ||
<div></div> | ||
|
||
- [Post sub-heading 1.1](#post-sub-heading-1-dot-1) | ||
- [Post sub-heading 1.2](#post-sub-heading-1-dot-2) | ||
- [Post sub-heading 1.3](#post-sub-heading-1-dot-3) | ||
|
||
</div> | ||
<!--endtoc--> | ||
|
||
|
||
### Post sub-heading 1.1 {#post-sub-heading-1-dot-1} | ||
|
||
|
||
#### Post sub-heading 1.1.1 {#post-sub-heading-1-dot-1-dot-1} | ||
|
||
|
||
### Post sub-heading 1.2 {#post-sub-heading-1-dot-2} | ||
|
||
|
||
### Post sub-heading 1.3 {#post-sub-heading-1-dot-3} | ||
|
||
|
||
## Post sub-heading 2 {#post-sub-heading-2} | ||
|
||
|
||
### Post sub-heading 2.1 {#post-sub-heading-2-dot-1} | ||
|
||
|
||
### Post sub-heading 2.2 {#post-sub-heading-2-dot-2} | ||
|
||
Below, TOC is exported with only up to level-2 headings **relative to** | ||
this "Post sub-heading 2.2" section. | ||
|
||
<div class="ox-hugo-toc toc local level-3"> | ||
<div></div> | ||
|
||
- [Post sub-heading 2.2.1](#post-sub-heading-2-dot-2-dot-1) | ||
- [Post sub-heading 2.2.2](#post-sub-heading-2-dot-2-dot-2) | ||
- [Post sub-heading 2.2.3](#post-sub-heading-2-dot-2-dot-3) | ||
- [Post sub-heading 2.2.3.1](#post-sub-heading-2-dot-2-dot-3-dot-1) | ||
- [Post sub-heading 2.2.3.2](#post-sub-heading-2-dot-2-dot-3-dot-2) | ||
|
||
</div> | ||
<!--endtoc--> | ||
|
||
|
||
#### Post sub-heading 2.2.1 {#post-sub-heading-2-dot-2-dot-1} | ||
|
||
|
||
#### Post sub-heading 2.2.2 {#post-sub-heading-2-dot-2-dot-2} | ||
|
||
|
||
#### Post sub-heading 2.2.3 {#post-sub-heading-2-dot-2-dot-3} | ||
|
||
Below, TOC is exported with only level-1 headings **relative to** this | ||
"Post sub-heading 2.2.3" section. | ||
|
||
<div class="ox-hugo-toc toc local level-4"> | ||
<div></div> | ||
|
||
- [Post sub-heading 2.2.3.1](#post-sub-heading-2-dot-2-dot-3-dot-1) | ||
- [Post sub-heading 2.2.3.2](#post-sub-heading-2-dot-2-dot-3-dot-2) | ||
|
||
</div> | ||
<!--endtoc--> | ||
|
||
|
||
##### Post sub-heading 2.2.3.1 {#post-sub-heading-2-dot-2-dot-3-dot-1} | ||
|
||
|
||
##### Post sub-heading 2.2.3.2 {#post-sub-heading-2-dot-2-dot-3-dot-2} | ||
|
||
|
||
## Post sub-heading 3 {#post-sub-heading-3} | ||
|
||
|
||
### Post sub-heading 3.1 {#post-sub-heading-3-dot-1} |
03fe85a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vvsagar Your Gitlab site repo revealed a bug in
ox-hugo
; I had never tested#+toc: headlines N local
usingox-hugo
. That was buggy, and now fixed.03fe85a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to be helpful!