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

There is apparently no support for custom theme options #18

Open
marcinant opened this issue Apr 17, 2014 · 7 comments
Open

There is apparently no support for custom theme options #18

marcinant opened this issue Apr 17, 2014 · 7 comments
Labels

Comments

@marcinant
Copy link

Short example from http://www.tumblr.com/docs/en/custom_themes/#theme-options
Input ./test.html.erb :

<html>
    <head>
        <meta name="text:Flickr Username" content=""/>
    </head>
    <body>
        {block:IfFlickrUsername}
            <div id="flickr_widget">
                <script type="text/javascript"
                src="http://flickr.com/widget?user={text:Flickr Username}">
                </script>
            </div>
        {/block:IfFlickrUsername}
    </body>
</html>

Output on http://0.0.0.0:4567/test.html :

NoMethodError at /test.html
undefined method `capitalize' for nil:NilClass
Ruby    /usr/lib/ruby/gems/1.9.1/gems/activesupport-4.0.4/lib/active_support/inflector/methods.rb: in block in camelize, line 72
Web     GET 0.0.0.0/test.html

Could someone give me an advice how to solve this problem?
Does Tumblargh support custom variables and theme options?

@jasonwebster
Copy link
Owner

Thanks for the report. It should support theme variables, however this looks to be potentially unrelated. I'll write a test case for your example and track down the issue.

@marcinant
Copy link
Author

I forund a kind of a workaround.
I just moved all variables to data files and configured different data files for development and build.
For example: I got /data/devel/flickr.yml and /data/build/flickr.yml

Devel version:

username: "someusername"

Build version:

username: "{text:Flickr Username}"

Then in my layout I can use: data.flickr.username and Middleman will render this differently for development and build.

But it's just a workaround.

@jasonwebster
Copy link
Owner

@marcinant
Copy link
Author

Well, I'll try it in a minute.

But in a meanwhile I got another problem with code copied from Disqus.

RuntimeError at /
No appearance option for if:disqusshortname
Ruby    /usr/lib/ruby/gems/1.9.1/gems/tumblargh-0.2.2/lib/tumblargh/renderer/document.rb: in rescue in custom_value_for_type, line 51
Web     GET 0.0.0.0/

Source is here:
http://help.disqus.com/customer/portal/articles/758168-tumblr-manual-installation-instructions

And I got meta in header...

@marcinant
Copy link
Author

BTW my platform is Linux with Ruby:

ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]

Could this cause problems?

@jasonwebster
Copy link
Owner

Oh.

So, it seems as if when rendering, we don't support conditionals for meta options other than boolean ones.

@marcinant
Copy link
Author

Partially fixed with #19

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

2 participants