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

Passing variable to templates #189

Open

Description

@nouun

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.

Activity

  1. gabrielpoca commented on Dec 9, 2022

    @gabrielpoca
    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions