Skip to content
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

Global value not changed in _layout.ejs after update in partial #616

Open
mankewd opened this issue Oct 1, 2017 · 4 comments
Open

Global value not changed in _layout.ejs after update in partial #616

mankewd opened this issue Oct 1, 2017 · 4 comments
Assignees
Labels

Comments

@mankewd
Copy link

mankewd commented Oct 1, 2017

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

@sintaxi
Copy link
Owner

sintaxi commented Oct 1, 2017

Is there a reason these are .txt files?

@mankewd
Copy link
Author

mankewd commented Oct 1, 2017 via email

@misterhtmlcss
Copy link
Collaborator

@sintaxi @mankewd did we get anywhere on this issue?

@sintaxi
Copy link
Owner

sintaxi commented Oct 4, 2018

I'll write a test for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants