LMS LMS - 1 year ago 41
JSON Question

_data.json variables not being loaded

I've set up Harp, and it is running and serving content, but any values stored in

seem to have no effect.

Directory structure:

|-- _harp.json
|-- _data.json
|-- _layout.ejs
|-- index.md
|-- getting-started.md

The file

"globals": {
"title": "Home"


"getting-started": {
"title": "Getting Started"


<!DOCTYPE html>
<title><%= title %> &mdash; My Website</title>
<%- yield %>

The layout, and page contents, load correctly, and
<%= title %>
is replaced with the value given in
. However, when an entry exists within
, no replacement is made and it continues to be replaced with the value in

Have I missed the obvious with this? Thank you in advance.

Answer Source

It appears that Harp required a restart, although this wasn't mentioned in Harp's documentation. It also appears to require a restart each time _data.json is modified.