pmd/docs/pages/mydoc/mydoc_kb_layout.md
Andreas Dangel b193bb28d8 Add 'docs/' from commit '106142b25c9387ffd002437027ced1b04f494205'
git-subtree-dir: docs
git-subtree-mainline: 23545aa7ea599faf17737de9879733a1bde700d1
git-subtree-split: 106142b25c9387ffd002437027ced1b04f494205
2017-05-25 10:01:42 +02:00

4.3 KiB

title tags keywords last_updated summary sidebar permalink toc folder
Knowledge-base layout
special_layouts
knowledge base, support portal, grid, doc portal July 3, 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 used for the graphics, and the layout is pulled from the Modern Business theme. . mydoc_sidebar mydoc_kb_layout.html false mydoc

Here's the sample knowledge-base style layout:

Knowledge Base Categories

Getting started

Lorem ipsum dolor sit amet, consectetur adipisicing elit.

Learn More

Navigation

Lorem ipsum dolor sit amet, consectetur adipisicing elit.

Learn More

Single sourcing

Lorem ipsum dolor sit amet, consectetur adipisicing elit.

Learn More

Formatting

Lorem ipsum dolor sit amet, consectetur adipisicing elit.

Learn More

Generating 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 | remove: "/" }}">{{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 %}

{% include links.html %}