I have a n index.html inside my layout folder, is there a way to use shortcode inside it?

Hello I was trying to work my way through a issue, the code had shortcodes being rendered in content files, the task was to try and reuse the shortcode inside of a component in an index.html file located in the root of layout. I tried working my way out but couldnot succeed. Is there anyone who can help me out?

This roughly what I tired

<div>
    {{ <formated_box> }}
    {{ </formated_box> }}
</div>

Also is it somehow possible to create an html components and export it both as shortcode and partial somehow?

Shortcodes are for content files only.

But you may call a partial from within a shortcode.

  • create a partial
  • use it in template files
  • create a shortcode that calls the partial
  • use that in content files

Thank you. But how do I pass params into the partial from the template where it is being used? It has more than one param

Check this one