-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_data.json not available in _layout.ejs (only when using harp compile) #333
Comments
Thanks for the thorough report. I think what is happening is Do you have any other templates in your project that don't set
hope this helps. |
Thanks for the response!
There's only a
My |
I recently started using harp and run into this problem and the cause of it was when I add README.md file in the root directory. Let me know if this solution works for you. |
I am running into this issue as well. I was fighting with it for a while. The solution was to delete the node_modules folder. I have harp installed globally, and wasn't using any locally installed packages until now. My website is in the root folder of the project (not /public). |
I found that removing the A more detailed explanation is I had several pages in my |
Relevant files
_data.json:
_layout.ejs:
index.ejs:
The problem
The construction above works when using
harp server
. The content of the site is:However, the same constellation throws an error when compiling the code with
harp compile
:Provisional solution
It works when I define the
title
global in the_harp.json
:The content of
title
will be overwritten by thetitle
in_data.json
. It's the same like shown in this example: https://gist.github.com/kennethormandy/6834709The content of the page is now corrent and also works with
harp compile
.The text was updated successfully, but these errors were encountered: