Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Using site.[CONFIGURATION_DATA] #3

Open
dab opened this issue Jul 27, 2009 · 2 comments
Open

Using site.[CONFIGURATION_DATA] #3

dab opened this issue Jul 27, 2009 · 2 comments

Comments

@dab
Copy link

dab commented Jul 27, 2009

Tried to use variables from _config.yml and get error:

Configuration from ./_config.yml
Enabled Haml
Building site: . -> ./_site
/usr/local/lib/ruby/gems/1.8/gems/jekyll-0.5.2/bin/../lib/jekyll/core_ext.rb:27:in `method_missing': undefined method `myName' for #<ClosedStruct topics={}, posts=[<Post: /blog/welcome>], categories={"blog"=>[<Post: /blog/welcome>]}, time=Mon Jul 27 11:28:49 +0300 2009, tags={"self"=>[<Post: /blog/welcome>]}, related_posts=[]> (NoMethodError)
    from (haml):19:in `render'
    from /usr/local/lib/ruby/gems/1.8/gems/haml-2.2.2/lib/haml/engine.rb:167:in `render'
    from /usr/local/lib/ruby/gems/1.8/gems/haml-2.2.2/lib/haml/engine.rb:167:in `instance_eval'
    from /usr/local/lib/ruby/gems/1.8/gems/haml-2.2.2/lib/haml/engine.rb:167:in `render'
    from /usr/local/lib/ruby/gems/1.8/gems/jekyll-0.5.2/bin/../lib/jekyll/convertible.rb:72:in `render_haml_in_context'
    from /usr/local/lib/ruby/gems/1.8/gems/jekyll-0.5.2/bin/../lib/jekyll/convertible.rb:105:in `do_layout'
    from /usr/local/lib/ruby/gems/1.8/gems/jekyll-0.5.2/bin/../lib/jekyll/post.rb:226:in `render'
    from /usr/local/lib/ruby/gems/1.8/gems/jekyll-0.5.2/bin/../lib/jekyll/site.rb:172:in `read_posts'
    from /usr/local/lib/ruby/gems/1.8/gems/jekyll-0.5.2/bin/../lib/jekyll/site.rb:171:in `each'
    from /usr/local/lib/ruby/gems/1.8/gems/jekyll-0.5.2/bin/../lib/jekyll/site.rb:171:in `read_posts'
    from /usr/local/lib/ruby/gems/1.8/gems/jekyll-0.5.2/bin/../lib/jekyll/site.rb:210:in `transform_pages'
    from /usr/local/lib/ruby/gems/1.8/gems/jekyll-0.5.2/bin/../lib/jekyll/site.rb:216:in `transform_pages'
    from /usr/local/lib/ruby/gems/1.8/gems/jekyll-0.5.2/bin/../lib/jekyll/site.rb:213:in `each'
    from /usr/local/lib/ruby/gems/1.8/gems/jekyll-0.5.2/bin/../lib/jekyll/site.rb:213:in `transform_pages'
    from /usr/local/lib/ruby/gems/1.8/gems/jekyll-0.5.2/bin/../lib/jekyll/site.rb:212:in `each'
    from /usr/local/lib/ruby/gems/1.8/gems/jekyll-0.5.2/bin/../lib/jekyll/site.rb:212:in `transform_pages'
    from /usr/local/lib/ruby/gems/1.8/gems/jekyll-0.5.2/bin/../lib/jekyll/site.rb:126:in `process'
    from /usr/local/lib/ruby/gems/1.8/gems/jekyll-0.5.2/bin/jekyll:135
    from /usr/local/bin/jekyll:19:in `load'
    from /usr/local/bin/jekyll:19

I used it as written here:

site.[CONFIGURATION_DATA]    
As of 0.5.2, all data inside of your _config.yml is now available through the site variable. So for example, if you have url: http://mysite.com in your configuration file, then in your posts and pages it can be used like so: {{ site.url }}. Jekyll does not parse a changed _config.yml in auto mode, you have to restart jekyll.
@henrik
Copy link
Owner

henrik commented Jul 27, 2009

Ah, I should add support for that. Thanks.

@dab
Copy link
Author

dab commented Jul 27, 2009

Great! Thank you for this.
I'm learning ruby, so will be happy to move forward with your code.

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

No branches or pull requests

2 participants