Open geometryolife opened 1 year ago
Hello, this is the expected behavior.
Markdown doesn't have a "title" syntax. So the Org mode title gets converted to Hugo markdown's title
front-matter.
The Hugo template usually renders the title
front-matter as h1
HTML tag. So the headings of the post are exported as ##
in Markdown so that they get rendered to h2
in HTML.
Here's a workaround.. but I really really do NOT recommend going this route.
#+hugo_base_dir: .
#+hugo_section: docs
#+hugo_front_matter_format: yaml
#+hugo_level_offset: 0
#+options: author:nil
* Aptos Move by Example
** TODO Dummy title -- Make sure you don't render the title front-matter in Hugo templates
:PROPERTIES:
:EXPORT_FILE_NAME: my-first-docs
:END:
*** My first docs
**** H1
***** S1
***** S2
**** H2
***** Sub
**** H3
Markdown export:
---
title: "Dummy title – Make sure you don't render the title front-matter in Hugo templates"
draft: true
---
# My first docs {#my-first-docs}
## H1 {#h1}
### S1 {#s1}
### S2 {#s2}
## H2 {#h2}
### Sub {#sub}
## H3 {#h3}
Thank you @kaushalmodi
Thanks for your answer, I saw this method from #375, I also think this method is not very good.
I'd like to request this feature, and it would be nice to add a property to ox-hugo to do this.
In fact, Markdown Docs of many document frameworks will use #
as the Headline 1 of a file, such as Docusaurus, hugo-book etc.
In fact, Markdown Docs of many document frameworks will use # as the Headline 1 of a file, such as Docusaurus, hugo-book etc.
Thank you. I was not aware of that.
I'd like to request this feature, and it would be nice to add a property to ox-hugo to do this.
I am severely restricted on my time for this project as I still need to fix the GHA CI before I make any changes. I would believe that any Hugo project should respect the title in the title
front-matter and render that as h1
tag. If this feature gets implemented in the future, it shouldn't need you to change any of your Org mode content.
If this feature gets implemented in the future, it shouldn't need you to change any of your Org mode content.
Thanks, some frameworks treat docs and blog types differently, docs
type documents use #
as the title, and bolg
type documents use title
in front-matter
as the title.
docs type documents use # as the title, and bolg type documents use title in front-matter as the title.
I hope it is easy to fix that inconsistency in the framework's Hugo template.
Pseudocode:
if (title != "") {
Render title as h1
}
Actual Behavior
Expected Behavior
How to Reproduce the Issue
Example Org File
Generated Markdown File or Error
Ox-Hugo Debug Information
Debug Info