Skip to content

Instantly share code, notes, and snippets.

@luke-john
Created August 20, 2015 04:16
Show Gist options
  • Save luke-john/8efec50694ca15e483e4 to your computer and use it in GitHub Desktop.
Save luke-john/8efec50694ca15e483e4 to your computer and use it in GitHub Desktop.
View all components in one page
layout title group
docs
View all
components
    {% for page in site.data.nav[3].pages %}
  • {{ page.title }}
  • {% endfor %}

{% for page in site.data.nav[3].pages %}

{{ page.title }}

{% capture content %}{% include_relative {{page.title | downcase | replace: ' ','-' }}.md %}{% endcapture %}

{% assign lines = content | newline_to_br | split: "
" %}

{% assign newContent = "" %} {% for l in lines %} {% if forloop.index >= 6 %} {% assign newContent = newContent | append: l %} {% endif %} {% endfor %} {{ newContent | markdownify }} {% endfor %}

@luke-john
Copy link
Author

assumes viewall.md is placed in docs/components

access by visiting http://0.0.0.0:9001/components/viewall

To setup a viewall for content and layout place the above file into the layout and content folders replace the nav index to 1 and 2 accordingly.

Layout: site.data.nav[1]
Content: : site.data.nav[2]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment