【发布时间】:2014-02-27 18:49:48
【问题描述】:
我正在尝试使用 Twitter 的图库卡片来展示 Tumblr 照片集。这是代码的相关部分,使用 Twitter 验证一切都很好:
{block:Photoset}
<meta name="twitter:card" content="gallery">
{block:Photos}<meta name="twitter:image" content="{PhotoURL-500}"/>{/block:Photos}
{block:Photos}<meta name="twitter:image0" content="{PhotoURL-500}"/>{/block:Photos}
{block:Photos}<meta name="twitter:image1" content="{PhotoURL-500}"/>{/block:Photos}
{block:Photos}<meta name="twitter:image2" content="{PhotoURL-500}"/>{/block:Photos}
{block:Photos}<meta name="twitter:image3" content="{PhotoURL-500}"/>{/block:Photos}
{block:Caption}<meta name="twitter:title" content="Photo Gallery"/>{/block:Caption}
{/block:Photoset}
但是,如果您仔细观察,您可能会发现我的问题。我不知道如何获取每个图像的唯一 URL。 {PhotoURL-500} 总是只返回相同的图像。根据我对 Tumblr 文档 (http://www.tumblr.com/docs/en/custom_themes#photoset-posts) 的明显错误阅读,{block:Photoset} 中的 {block:Photos} 似乎应该循环通过。
我错过了什么?
另外 - 是的,我知道我已经硬编码了 twitter:Title 的内容。
【问题讨论】:
标签: tumblr twitter-card