Custom Tumblr them with Handlebars

≯℡__Kan透↙ 提交于 2019-12-11 07:59:08

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!