Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable default block content in Diet templates #1002

Merged
merged 1 commit into from
Mar 9, 2015

Conversation

redstar
Copy link
Contributor

@redstar redstar commented Mar 7, 2015

With Jade templates, you can define a default block content which is used if no content for a block is provided.
This is also possible with vibe.d - but an assertion prevents this.
IMHO the assertion is a cut'n'paste error. Removing it enables use of default block content.

With Jade templates, you can define a default block content which
is used if no content for a block is provided.
This is also possible with vibe.d - but an assertion prevents this.
IMHO the assertion is a cut'n'paste error. Removing it enables
use of default block content.
@s-ludwig
Copy link
Member

s-ludwig commented Mar 9, 2015

Hm, interesting. In fact this was never implemented (the // output defaults comments are supposed to read // TODO: output defaults) and it's pure coincidence that it works for the default case. I'll add back an assertion for the append/prepend cases and add some unit tests for the default one.

s-ludwig added a commit that referenced this pull request Mar 9, 2015
Enable default block content in Diet templates
@s-ludwig s-ludwig merged commit 6ef9ab9 into vibe-d:master Mar 9, 2015
s-ludwig added a commit that referenced this pull request Mar 9, 2015
The append mode now triggers an error message as before.
@s-ludwig
Copy link
Member

s-ludwig commented Mar 9, 2015

Okay should be working correctly now. With only the assertion removed it would always append the default block contents, even if the block was overridden. "prepend" also works, but "append" is disabled again, as that is a little more involved to implement.

@redstar redstar deleted the defaultblock branch March 9, 2015 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants