Hi, I create my content file structure like below. And
jupyter.md and jupyter.html will be used as resource of page
After render my blog
But rendered site not contains jupyter.html and jupyter.md. how can i contain html and md? Please help me.
Hi, I create my content file structure like below. And
jupyter.md and jupyter.html will be used as resource of page
After render my blog
But rendered site not contains jupyter.html and jupyter.md. how can i contain html and md? Please help me.
In your single template, you can grab the page resources you want (jupyter.html
and jupyter.md
) and insert their content alongside your main content.
Must I place my md and html resource file alongside my content manually? unlike other resource? or if i grob my resource on template file, then it is done automatically? and how can i grob my resource? i am not friendly with template language
Hereβs a quick example. Given content like this
content/
βββ section
βββ page-1
βββ index.md
βββ jupyter.html
βββ jupyter.md
Then this code in template layouts/_default/single.html
{{ .Content }}
{{ $matches := .Resources.Match "*jupyter*" }}
{{ range $matches }}
Filename = {{ .Name }}
Content = {{ .Content }}
{{ end }}
Will give output in file public\section\page-1\index.html
<p>main content.</p>
Filename = jupyter.html
Content = html content.
Filename = jupyter.md
Content = <p>markdown content.</p>
Thank you for your solution. Just like you said, I rewrite my themeβs layout template. Although md and html file not copied to /public, But the contents of them merged into index.html. (I was going to use βiframeβ tag for html).
Now I make my custom shortcode βmerge_htmlβ. Thank you.
<div> {{ (.Page.Resources.GetMatch (.Get 0)).Content }} </div>