Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Jekyll, how does include_relative work with respect to layout files?

I have a file called default.html in my layouts folder. In default.html, I want to add a relative include to test.html, which is also in my layouts folder.

I add {% include_relative test.html }% in my default.html file to include test.html. However, when I do this, I get an error that says

"Liquid Exception: Included file './test.html' not found in
projects/[projectnmae]/layouts/default.html"

I do have my layouts folder in a different location, as specified in my configuration file. Any ideas if include_relative works in a special way here that I'm not grasping?

like image 612
Tom Johnson Avatar asked Sep 05 '25 03:09

Tom Johnson


1 Answers

You can't use the include_relative tag with any files inside your layouts folder. You can only use include_relative on a page or post.

like image 154
Tom Johnson Avatar answered Sep 08 '25 00:09

Tom Johnson