Hugo markdown to clean markdown

is it possible to get a clean processed .md file from md files with hugo code?

Hi,

Have a look at Output Formats: https://gohugo.io/templates/output-formats/

I saw this page before writing a message. I still don’t understand whether it is possible to get the markdown output format without the hugo codes that were in the original .md

Could you describe the problem more precisely? Maybe include some examples?

Let’s say I have such a page for Hugo at a markdown. If you look at it in the program for viewing (for example, https://dillinger.io/), the code at the top and bottom of the page will be visible as text and break the markup. Is it possible to compile the original markdown file to a clean one so that the link is active and the text is not visible from above? (Sorry for my English)

> +++
> 
> date = "2018-01-31T11:40:21+01:00"
> 
> title = "some title"
> 
> weight = -50
> 
> page = ""
> 
> nextpage = "/doc/software_structure"
> 
> prevpage = "/doc/common/"
> 
> robotsdisallow = true
> 
> +++
> 
> # Some header
> 
> --------------
> 
> some text
> 
> - [some link with hugo code]({{< relref "doc/common/_index.md" >}})
> 
> -

Sure, here’s some tips:

  • https://dillinger.io/ won’t render this correctly because the file is not just markdown, it’s also “front matter” which is NOT markdown, but a separate format, TOML, used by Hugo for page metadata. https://gohugo.io/content-management/front-matter/

  • I’m not sure if this is just a copy-and-paste, error, but don’t start each line with a > character.

The following will render correctly in Hugo:

+++

date = "2018-01-31T11:40:21+01:00"

title = "some title"

weight = -50

page = ""

nextpage = "/doc/software_structure"

prevpage = "/doc/common/"

robotsdisallow = true

+++

# Some header

--------------

some text

- [some link with hugo code]({{< relref "doc/common/_index.md" >}})

-

Thank you for your help!
I understand that the top of the last post is not a markdown, and that “>” is not needed.
I mean, is it possible for Hugo to produce an .md file instead of html, in which the TOML would be deleted, and the link [some link with hugo code] ({{<relref “doc / common / _index.md”> }}) would turn into [some link with hugo code] (link made by Hugo)?

You can return the raw markdown with {{ .RawContent }} but this will not evaluate the shortcode to create the correct link. I’m not sure that what you want to do is possible with Hugo’s built-in functions.

Thank you very much for your help! RawContent is really not quite what I wanted. Perhaps it will be better if I ask a question differently in the new Topic