Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

Passing variable to templates #189

Open
nouun opened this issue Dec 7, 2022 · 1 comment
Open

Passing variable to templates #189

nouun opened this issue Dec 7, 2022 · 1 comment

Comments

@nouun
Copy link

nouun commented Dec 7, 2022

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.

@gabrielpoca
Copy link
Member

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants