سؤال

I've worked with Rails before but I'm having issues working my way around configuring the layout that I`m using.

I am using the Twitter theme, and under _includes/themes/_layouts/default.html, I want to be able to link to other pages under the nav as opposed to the default. I understand that the pages are given by the site.pages variable but I don't know how to modify it.

      <ul class="nav">
        {% assign pages_list = site.pages %}
        {% assign group = 'navigation' %}
        {% include JB/pages_list %}
      </ul>

I want to link the about.html page that I have created using rake page name="about.md" to a subtopic under the navigation class as listed above.

In addition, how do I print out debugging statements? In ERB templating, I was simply able to print to the log, however something like {{print "Hello"}} is illegal, so what is the preferred way of doing this?

هل كانت مفيدة؟

المحلول

What you should do, I think, is add group: navigation to your yaml header of about.md, and remained defalut navbar code unchanged. It put the about.md to the navgationgroup, {% assign group = 'navigation' %}, this code tell use navgationgroup generate navbar links

about.md yaml header like this

---
layout: page
title: About
header : About 
group: navigation
--- 
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top