我想实现一个新闻标题横幅。
该标题横幅的 HTML 代码如下:
<!-- hot news start -->
<div class="col-sm-16 hot-news hidden-xs">
<div class="row">
<div class="col-sm-15"> <span class="ion-ios7-timer icon-news pull-left"></span>
<ul id="js-news" class="js-hidden">
<li class="news-item"><a href="">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor</a></li>
<li class="news-item"><a href="">Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium</a></li>
<li class="news-item"><a href="">Donec quam felis, ultricies nec, pellentesque eu</a></li>
<li class="news-item"><a href="">Nulla consequat massa quis enim. Donec pede justo, fringilla</a></li>
<li class="news-item"><a href=""> Donec pede justo, fringilla vel, aliquet nec, vulputate eget ultricies nec, pellentesque</a></li>
<li class="news-item"><a href="">In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo</a></li>
<li class="news-item"><a href="">Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis </a></li>
</ul>
</div>
<div class="col-sm-1 shuffle text-right"><a href="#"><span class="ion-shuffle"></span></a></div>
</div>
</div>
<!-- hot news end -->
我想做这个,以便它可以在模块化页面中使用。这个想法是用户可以只输入类似这样的内容:
news:
text: Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
url: foo.com/lorem
news:
text: Sed ut perspiciatis unde omnis iste natus error sit voluptatem
url: foo.com/sedut
...
整个块将被渲染。我想知道如何在 Grav/Twig 中实现它。如果有人回答,请记住,我对 Grav 比较陌生,所以详细的回答比简洁的回答更受欢迎。