4.4 KiB
4.4 KiB
title, tags, keywords, last_updated, summary, sidebar, permalink
title | tags | keywords | last_updated | summary | sidebar | permalink | |
---|---|---|---|---|---|---|---|
Knowledge-base layout |
|
knowledge base, support portal, grid, doc portal | March 20, 2016 | This shows a sample layout for a knowledge base. Each square could link to a tag archive page. In this example, font icons from Font Awesome are enlarged to a large size. You can also add captions below each icon. | mydoc_sidebar | /mydoc_kb_layout/ |
Knowledge Base Categories
Getting started
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
Learn MoreNavigation
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
Learn MoreSingle sourcing
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
Learn MoreFormatting
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
Learn MoreGenerating a list of all pages with a certain tag
If you don't want to link to a tag archive index, but instead want to list all pages that have a certain tag, you could use this code:
{% raw %}Getting started pages:
<ul>
{% assign sorted_pages = (site.pages | sort: 'title') %}
{% for page in sorted_pages %}
{% for tag in page.tags %}
{% if tag == "getting_started" %}
<li><a href="{{ page.url | prepend: site.baseurl}}">{{page.title}}</a></li>
{% endif %}
{% endfor %}
{% endfor %}
</ul>{% endraw %}
Here's the result:
Getting started pages:
-
{% assign sorted_pages = (site.pages | sort: 'title') %}
{% for page in sorted_pages %}
{% for tag in page.tags %}
{% if tag == "getting_started" %}
- {{page.title}} {% endif %} {% endfor %} {% endfor %}