Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

生成导航 #3

Closed
creamidea opened this issue Nov 14, 2013 · 0 comments
Closed

生成导航 #3

creamidea opened this issue Nov 14, 2013 · 0 comments

Comments

@creamidea
Copy link
Owner

_config.yml

bucket_title:
- text: archive
  url: /archive/index.html
- text: tags
  url: /tags/index.html
- text: draft
  url: https://github.com/creamidea/creamidea.github.com/tree/master/_draft
- text: emotion
  url: http://www.douban.com/people/creamidea/notes

bucket_title.html

{% unless page.layout == 'front' %}
<nav class="bucket-sort">
  {% for title in site.bucket_title %}
  {% assign page_url = page.url|split: '/' %}
  {% if page_url[1] == title.text or page.layout == link.layout %}
  {% assign href = "#" %}
  {% assign class = "no-link" %}
  {% assign active = "active" %}
  {% else %}
  {% assign href = title.url %}
  {% assign class = "" %}
  {% assign active = "" %}
  {% endif %}
  <h5 class="bucket-title {{active}}">
    <a  href="{{ href }}" class="{{ class }}">
      <span class="bucket-header-title">{{ title.text }}</span>
    </a>
  </h5>
  {% endfor %}
</nav>
{% endunless %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant