You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to dynamically set the page title of the pages in my static site using a recipe suggested by Raymond Camden. (https://www.raymondcamden.com/2015/07/08/using-friendlier-urls-for-a-harpjs-static-site/). I've pared down the example to just the code I want to retrieve the pageTitle based on the file path and the code seems to be working but oddly the pageTitle global is still unset in my _layout.ejs and the rendered page does not contain the pageTitle selected from the list defined in my _data.json array.
I've attached my code, can anyone see a problem with my structure? Or is there some timing issue in the pre-processing phase when Harp is generating the HTML files for the static site? The HarpJS documentation states that globals are available to all elements, layout, partials, etc but it doesn't seem to work in my site. Thanks for taking a look.
Yes, Github doesn't allow files with ejs or json extensions to be uploaded so I just added a .txt extension to the original file names. Sorry I didn't clarify that when I logged this issue.
I'm trying to dynamically set the page title of the pages in my static site using a recipe suggested by Raymond Camden. (https://www.raymondcamden.com/2015/07/08/using-friendlier-urls-for-a-harpjs-static-site/). I've pared down the example to just the code I want to retrieve the pageTitle based on the file path and the code seems to be working but oddly the pageTitle global is still unset in my _layout.ejs and the rendered page does not contain the pageTitle selected from the list defined in my _data.json array.
I've attached my code, can anyone see a problem with my structure? Or is there some timing issue in the pre-processing phase when Harp is generating the HTML files for the static site? The HarpJS documentation states that globals are available to all elements, layout, partials, etc but it doesn't seem to work in my site. Thanks for taking a look.
_harp.json.txt
_layout.ejs.txt
_page_parser.ejs.txt
_data.json.txt
The text was updated successfully, but these errors were encountered: