Frage

I'm using Jade without Node, I'm simply using the software Prepros to compile the templates to static HTML.

I want to include partials that are outside of the folder the Jade templates are in, like so:

include /partials/foo.html

However, using paths that begin with a / with include in Prepros gives the following error:

the "basedir" option is required to use "include" with "absolute" paths

Usually you could set the basedir using something like app.locals.basedir = __dirname + '/views', but there's no way to do this with Prepros. Is there some other way?

War es hilfreich?

Lösung

It is security restriction imposed by jade language. I have added a workaround in Prepros Jade compiler to fix this issue, fix will be available from the next version of Prepros.

Andere Tipps

You can just deleted / and it will works.

You also can add the path in the root folder and just call it like foot.html.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top