更新时间:2023-11-27 20:25:34
我认为以下代码应为您工作:
I think the following code should work for you:
<nav id="menu">
<ul class="links">
<li><a href="#">Home</a></li>
{% for page in site.pages %}
{% if page.layout == "home" or page.url contains ".xml" %}
{% else %}
<li><a href="{{ page.url }}">{{ page.title }}</a></li>
{% endif %}
{% endfor %}
<div class="content">
<ul class="actions">
<li><a href="#contact" id="contact-btn">Contact</a></li>
</ul>
</div>
</ul>
<ul class="actions vertical">
<li><a href="#" class="button special fit">Subscribe to Newsletter</a>
</li>
</ul>
</nav>
请注意,我删除了页面上的多余循环,以加快构建速度.我也认为不需要absolute_url语句.您确定要在ul中打开div吗?
Note that I removed the extra loop over the pages to make the build quicker. I also think the absolute_url statement is not needed. Are you sure you want to open a div inside an ul?