2.0.9 • Published 3 years ago

@stageny/engine-pug v2.0.9

Weekly downloads
22
License
GPL-3.0-only
Repository
-
Last release
3 years ago

Adds some crazy useful mixins to every pug template.

+Component(name, options = {})

+Component("Name", { title: "Hello", text: "world" })(text="you" variant="new")
	p So fancy, isn't it.

is the equivalent to:

!= component("Name", { content: "<p>So fancy, isn't it.</p>", title: "Hello", text: "world", variant: "new", attributes: { text: "you", variant: "new" } })

So basically we do:

mergedOptions = Object.assign(
	{},
	attributes,
	options,
	{ content: block() }
)

and then:

!= component(name, mergedOptions)

+Capture(key, callback = null)

+Capture('paragraph')
	p Hello world

is the equivalent to:

- capture('paragraph', '<p>Hello world</p>)

For a documentation of capture and component see @stageny/base.

2.0.5

3 years ago

2.0.9

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

2.0.0-alpha.3

3 years ago

2.0.0-alpha.4

3 years ago

2.0.0-alpha.5

3 years ago

2.0.0-alpha.0

3 years ago

2.0.0-alpha.2

3 years ago

1.0.9

4 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago