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

Comments

Projects
None yet
2 participants
@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

This comment has been minimized.

Show comment
Hide comment
@jnordberg

jnordberg Jul 3, 2013

Owner

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

Owner

jnordberg commented Jul 3, 2013

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

@johngeorgewright

This comment has been minimized.

Show comment
Hide comment
@johngeorgewright

johngeorgewright Jul 3, 2013

Jade. I assume that's default?

johngeorgewright commented Jul 3, 2013

Jade. I assume that's default?

@johngeorgewright

This comment has been minimized.

Show comment
Hide comment
@johngeorgewright

johngeorgewright 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

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

This comment has been minimized.

Show comment
Hide comment
@jnordberg

jnordberg Jul 3, 2013

Owner

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

Owner

jnordberg commented Jul 3, 2013

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

@johngeorgewright

This comment has been minimized.

Show comment
Hide comment

johngeorgewright commented Jul 3, 2013

Ta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment