~adnano/kiln-discuss

2 2

All non-partial templates to inherit from _default/base.ext

Details
Message ID
<CN3UOUHBJVI0.26BJ2BRDYLPY6@henleybeach>
DKIM signature
missing
Download raw message
Currently the TEMPLATE man page section says of the base template:

> base.ext - Base template from which the page and index templates
> inherit

And additionally:

> Fallback templates can be specified in the templates/_default
> directory.
> These templates will apply to any directory which does not have its
> own
> templates specified in the template directory.

However, the base template is currently only found by searching in the
directory of the inheriting template, not in templates/_default.

For example:
templates/_default/index.html inherits from templates/_default/base.html
templates/blog/index.html inherits from templates/blog/base.html

but:
templates/blog/index.html does not inherit from
templates/_default/base.html

Using templates/_default/base.ext as a base in case the
directory-specific one doesn't exist would be useful for site-wide
default bases.  The current behaviour could be restored by users by
putting blank base.ext files in the template directores that they don't
want to inherit from the default base.

The partial templates would need to be excluded from this new behaviour.

Would you consider a patch for this?
Details
Message ID
<CN3WSTOWGMRH.316FEJIYQ4MNV@nitro>
In-Reply-To
<CN3UOUHBJVI0.26BJ2BRDYLPY6@henleybeach> (view parent)
DKIM signature
missing
Download raw message
On Fri Sep 23, 2022 at 10:29 AM EDT, Edd Salkield wrote:
> Using templates/_default/base.ext as a base in case the
> directory-specific one doesn't exist would be useful for site-wide
> default bases.  The current behaviour could be restored by users by
> putting blank base.ext files in the template directores that they don't
> want to inherit from the default base.
>
> The partial templates would need to be excluded from this new behaviour.
>
> Would you consider a patch for this?

I would consider a patch for this. The patch should be accompanied with
an update to the documentation to clarify how the base template is
selected. Since this is a breaking change, it might be best to include
it in a 0.4.0 release.

We may also want to disallow partial templates from inheriting from a
base template. It is technically possible using the current design
(though undocumented).
Details
Message ID
<CN3XRKZ9EGZ3.3CEJF8AGR6ARO@henleybeach>
In-Reply-To
<CN3WSTOWGMRH.316FEJIYQ4MNV@nitro> (view parent)
DKIM signature
missing
Download raw message
> I would consider a patch for this.

Great, I'll work on one :)

> We may also want to disallow partial templates from inheriting from a
> base template. It is technically possible using the current design
> (though undocumented).

I agree.
Reply to thread Export thread (mbox)