still icon indicating copy to clipboard operation
still copied to clipboard

Passing variable to templates

Open nouun opened this issue 3 years ago • 1 comments

I have a header which I would like to be able to pass a title from the body but I can't figure out a way to accomplish this.

nouun avatar Dec 07 '22 08:12 nouun

Hello 👋

You can pass in variables in the third argument. For instance, in your layout:

body
  = include(@env, "header.slime", dark: true)

And then, on the header, you will have the variables @dark and @env[:dark] defined. Is this what you were looking for?

gabrielpoca avatar Dec 09 '22 17:12 gabrielpoca