You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the following file setup, using diet-ng with vibe.d (WebInterface)(the original diet implementation also has this issue):
layout.dt provides my page structure. leftnav.dt is included by layout.dt for navigation.
And my pages, which extend layout.dt and attempt to override a block in leftnav.dt. I would expect that since the block is included by layout.dt any file that extends layout.dt would be able to override it, but my attempts to do so are ignored - the overriding block doesn't make it into the html at all.
If I actually copy the contents of leftnav.dt into layout.dt everything works as expected. According to the diet documentation include is effectively a copy-paste, but it isn't quite working that way.
I could also work around it by passing data to the render function (as adding "active" to the li class is all I really care about here), but would prefer not to do that.
//- layout.dt
doctype html
html(lang="en")
head
blockhead
title Diet Include Test
body
div
//- I'll want to modify blocks in leftnav in child templates.includeleftnav
div.mainblockcontent
p Content goes here.
//- leftnav.dt
ul
//- These blocks should (but don't) let me adjust each individual item in other templates.blocknavIndex
li
a(href="/") Home
blocknavPage2
li
a(href="/pagetwo") Not Home
//- index.dtextendslayout//- I expect this block to override the block in layout.dt via the include, but is ignored.blocknavIndex
li
a(class="active", href="/") Home Override
blockcontent
h1 Hello!
p "Home" should say "Home Override".
//- pagetwo.dt is much the same as indexextendslayoutblockhead
title Diet Test - Page Two
blocknavPage2
li
a(class="active", href="/pagetwo") Page Two
blockcontent
h1 The second page.
p "Not Home" should say "Page Two".
The text was updated successfully, but these errors were encountered:
I have the following file setup, using diet-ng with vibe.d (WebInterface)(the original diet implementation also has this issue):
layout.dt
provides my page structure.leftnav.dt
is included bylayout.dt
for navigation.And my pages, which extend
layout.dt
and attempt to override a block inleftnav.dt
. I would expect that since the block is included bylayout.dt
any file that extendslayout.dt
would be able to override it, but my attempts to do so are ignored - the overriding block doesn't make it into the html at all.If I actually copy the contents of
leftnav.dt
intolayout.dt
everything works as expected. According to the diet documentationinclude
is effectively a copy-paste, but it isn't quite working that way.I could also work around it by passing data to the render function (as adding "active" to the li class is all I really care about here), but would prefer not to do that.
The text was updated successfully, but these errors were encountered: