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

Projects
None yet
2 participants
@redstar
Contributor

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.

Enable default block content in Diet templates
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

This comment has been minimized.

Show comment
Hide comment
@s-ludwig

s-ludwig Mar 9, 2015

Member

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.

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

Merge pull request #1002 from redstar/defaultblock
Enable default block content in Diet templates

@s-ludwig s-ludwig merged commit 6ef9ab9 into vibe-d:master Mar 9, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

s-ludwig added a commit that referenced this pull request Mar 9, 2015

Fix Diet default and prepend block modes and add unit tests. See #1002.
The append mode now triggers an error message as before.
@s-ludwig

This comment has been minimized.

Show comment
Hide comment
@s-ludwig

s-ludwig Mar 9, 2015

Member

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.

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 redstar:defaultblock branch Mar 9, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment