Organizing partials in subfolders?

Hi, I’m trying to organize partials into a separate directory under the www folder. Right now, a standard partial works just fine with {{> header}} where _header.html is under the www directory one level below. e.g. www/_header.html accessing it from www/index.html for example.

However, when I try to put the partial inside a subfolder (calling it includes) for organizational purposes and reference it from index.html using {{> includes/header}} it doesn’t work. Also, tried variations such as:

{{> includes/header}}
{{> /includes/_header}}
{{> ./includes/header}}
along with some other variations using _ and adding the .html and even quotes a la nunjucks.js syntax.

Is there another format that can work? Or, are we constrained to the first level of the www folder only?

thanks in advance!

@mariocontext Right now, Vapid only look for partials in the root folder, not subfolders. It sounds like a good feature request, though. If you’re interested, feel free to add a feature request issue on GitHub, and we’ll look into incorporating subfolder partials in a future release.

Thanks Scott! Will do.

1 Like

Hi Guys, I found this in the documentation, but it does not work. solution?

# some/directory/_menu.html
{{> some/directory/menu}}

@jotaandrade What version of Vapid are you using? The partials in subfolders feature was just released in v0.5.0.

1 Like

Sory Scott :heart_eyes:

1 Like

By the way, thanks for making this happen!


agreed, its a small but bad ass improvement