MD and HTML as page resource

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>

2 Likes