NavBar coding

Hi all,
New to Zola, been working on making a custom version of the original site at Getting Started Overview.

I was curious, is it possible to modify the code

 {% for page in section.pages %}
  <li><a href="{{ page.permalink | safe }}">{{ page.title }}</a></li>
  {% endfor %}

So that I can use it in the index.html file? Would like to have a NavBar that has the blog entries in it already. I’m currently using the Bulma CSS framework, so I tried this:

<div class="navbar-item has-dropdown is-hoverable">
          <a class="navbar-link">
            More
          </a>
  
          <div class="navbar-dropdown">
            {% for page in section.pages %}
            <a class="navbar-item" href="{{blog/page.permalink | safe }}">{{ page.title }}</a>
            {% endfor %}
          </div>
        </div>
      </div>

However the resulting HTML doesn’t include anything from the for loop.

Thanks in advance!

You could pull a section with get_ section, then use it with your code.

Thanks Charlie! that worked!

1 Like