Skip to content
This repository was archived by the owner on Apr 25, 2018. It is now read-only.
This repository was archived by the owner on Apr 25, 2018. It is now read-only.

Custom components proposal #7

@davepagurek

Description

@davepagurek

You could define a component in a separate file sort of like this:

define person with name, email, photo
  section.person
    h1
      given email
        a(href mailto:#{email}) #{name}
      unless email
        span #{name}
    img(src #{photo})

And then you can use it like this:

each users as user
  person(
    name #{user.name}
    email #{user.email}
    photo #{user.photo_url}
  )

We should probably make a gem or something to handle importing these.

Thoughts on syntax, etc? How do we differentiate between passing regular string attributes versus passing template hashes? (do we even want to support template hash parameters?)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions