我的页面在单独的元素中包含文章摘要和内容,我需要在即时文章中同时显示两者,但无需更改页面的HTML结构。
https://developers.facebook.com/docs/instant-articles/builder
<div class="summary-news">
<div class="summary-content">
<h3>Summary</h3>
<ul>
<li> Item 1</li>
<li> Item 2</li>
<li> ... </li>
</ul>
</div>
</div>
<div>
<!-- Other content -->
</div>
<div class="text">
<!-- Main content -->
</div>
答案 0 :(得分:0)
您可以将GlobalRule更改为您的设置,以特定于此整页的任何包装标签。
让我们说您在结构周围有一个<body>
标签:
<body>
<div class="summary-news">
<div class="summary-content">
<h3>Summary</h3>
<ul>
<li> Item 1</li>
<li> Item 2</li>
<li> ... </li>
</ul>
</div>
</div>
<div>
<!-- Other content -->
</div>
<div class="text">
<!-- Main content -->
</div>
</body>
然后,您只需要从article.body
设置中更改GlobalRule
属性即可获得此包装容器:
{
"class":"GlobalRule",
"selector":"html",
"properties":{
"article.title":{...},
"author.url":{...},
"author.name":{...},
"author.role_contribution" : {...},
"author.description" : {...},
"article.canonical": {...},
"article.publish": {...},
"article.body":{
"selector":"body", // Or whatever selector that grabs your container
"type":"element"
},
"image.url":{...}
}
}
这应该可以满足您的需要。