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

env property in index files #141

Closed
johngeorgewright opened this issue Jul 3, 2013 · 5 comments
Closed

env property in index files #141

johngeorgewright opened this issue Jul 3, 2013 · 5 comments

Comments

@johngeorgewright
Copy link

@johngeorgewright johngeorgewright commented Jul 3, 2013

Hey there,

I just installed the livereload plugin which requires me to include:

env.helpers.liverload()

"somewhere in my templates". So, I thought I'd just put it in my layout file. It works fine in all routes other than the index. Apparently the env property is undefined within the index file. How do I go about adding that?

Thanks,

@jnordberg
Copy link
Owner

@jnordberg jnordberg commented Jul 3, 2013

That's odd. Are you using some template plugin?

@johngeorgewright
Copy link
Author

@johngeorgewright johngeorgewright commented Jul 3, 2013

Jade. I assume that's default?

@johngeorgewright
Copy link
Author

@johngeorgewright johngeorgewright commented Jul 3, 2013

I just created a whole new wintersmith project.

wintersmith new test-index-file

Added the following to the content block of the index file:

- console.log(env.helpers)

Then tried previewing:

$ wintersmith preview
  starting preview server
  using config file: /home/john/Workspace/test-index-file/config.json
  server running on: http://localhost:8080/
  500 / 47ms

  error index.html: /home/john/Workspace/test-index-file/templates/index.jade:18
    16|             a(href=article.url) more
    17| 
  > 18|   - console.log(env.helpers)
    19| 
    20| block prepend footer
    21|   div.nav

Cannot read property 'helpers' of undefined

  404 /favicon.ico 2ms
@jnordberg jnordberg closed this in b959b35 Jul 3, 2013
@jnordberg
Copy link
Owner

@jnordberg jnordberg commented Jul 3, 2013

Should work now, I forgot to pass it along in the paginator plugin

@johngeorgewright
Copy link
Author

@johngeorgewright johngeorgewright commented Jul 3, 2013

Ta.

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.