问题
Haven't been able to find out any answers to this so far but I'm trying to use handlebars within tumblr's theme system and it looks like my {{variables}} are getting overwritten from tumblr and then my content is never displayed.
For example my handlebars template has
<img src="{{bgimage}}" class="img-responsive">
But it will output as
<img src="{}" class="img-responsive">
So it looks like tumblr is just removing it. I have seen others use handlebars within a theme however I just can't figure out how they got around it. Any help would be awesome, thanks!
回答1:
I think you just need to add a space to your handlebars template:
<img src="{{ bgimage }}" class="img-responsive">
Tumblr then renders it as:
<img src="{{ bgimage }}" class="img-responsive">
Handlebars.js
should be free to do its thing.
来源:https://stackoverflow.com/questions/23024632/custom-tumblr-them-with-handlebars