diff --git a/docs/_docs/datafiles.md b/docs/_docs/datafiles.md index 40723d2f..59a3ef3e 100644 --- a/docs/_docs/datafiles.md +++ b/docs/_docs/datafiles.md @@ -70,6 +70,8 @@ You can now render the list of members in a template: {% endraw %} ``` +{: .note .info } +If your Jekyll site has a lot of pages, such as with documentation websites, we've got you covered with some detailed examples on [how to build robust navigation for your site](..navigation). ## Example: Organizations diff --git a/docs/_docs/navigation.md b/docs/_docs/navigation.md index bbb009c7..548013a2 100644 --- a/docs/_docs/navigation.md +++ b/docs/_docs/navigation.md @@ -49,21 +49,24 @@ docs: {% raw %}

{{ site.data.samplelist.docs_list_title }}

{% endraw %} ``` **Result** -
+

ACME Documentation

+{: .note .info } +For the results in these samples with fictitious page references, `#` is manually substituted for the actual link value to avoid 404 errors.) + When you use a `for` loop, you choose how you want to refer to the items you're looping through. The variable you choose (in this case, `item`) becomes how you access the properties of each item in the list. Dot notation is used to get a property of the item (for example, `item.url`). The YAML content has two main types of formats that are relevant here: @@ -94,10 +97,10 @@ Suppose you wanted to sort the list by the `title`. To do this, convert the refe **Result** -
-
  • Configuration
  • -
  • Deployment
  • -
  • Introduction
  • + The items now appear in alphabetical order. The `sort` property in the Liquid filter applies to the `title`, which is an actual property in the list. If `title` weren't a property, we would need to sort by another property. @@ -158,26 +161,26 @@ toc: ``` **Result** -
    + @@ -240,64 +243,64 @@ toc2: {% raw %}
    {% if site.data.samplelist.toc2[0] %} {% for item in site.data.samplelist.toc2 %} -

    {{ item.title }}

    - {% if item.subfolderitems[0] %} -
      - {% for entry in item.subfolderitems %} -
    • {{ entry.page }}
    • - {% if entry.subsubfolderitems[0] %} - - {% endif %} - {% endfor %} -
    - {% endif %} - {% endfor %} +

    {{ item.title }}

    + {% if item.subfolderitems[0] %} +
      + {% for entry in item.subfolderitems %} +
    • {{ entry.page }}
    • + {% if entry.subsubfolderitems[0] %} + + {% endif %} + {% endfor %} +
    + {% endif %} + {% endfor %} {% endif %}
    {% endraw %} ``` **Result** -
    + - In this example, `if site.data.samplelist.toc2[0]` is used to ensure that the YAML level actually contains items. If there isn't anything at the `[0]` position, we can skip looking in this level. +In this example, `if site.data.samplelist.toc2[0]` is used to ensure that the YAML level actually contains items. If there isn't anything at the `[0]` position, we can skip looking in this level.
    ProTip: Line up for loops and if statements
    @@ -324,17 +327,17 @@ sidebar: toc ```liquid {% raw %}{% endraw %} ``` **Result** -
    + @@ -358,7 +361,8 @@ In addition to inserting items from the YAML data file into your list, you also ```liquid {% raw %}{% for item in site.data.samplelist.docs %}
  • - {{ item.title }}
  • + {{ item.title }} + {% endfor %}{% endraw %} ``` @@ -371,10 +375,10 @@ In addition to inserting items from the YAML data file into your list, you also } -
    -
  • Introduction
  • -
  • Configuration
  • -
  • Deployment
  • + In this case, assume `Deployment` is the current page. @@ -408,19 +412,19 @@ docs2: ```liquid {% raw %}
      {% for item in site.data.samplelist.docs2 %} - {% if item.version == 1 %} -
    • {{ item.title }}
    • - {% endif %} + {% if item.version == 1 %} +
    • {{ item.title }}
    • + {% endif %} {% endfor %}
    {% endraw %} ``` **Result** -
    + @@ -488,20 +492,20 @@ If you wanted to simply get all docs in the collection for a specific category, {% raw %}

    Getting Started

      {% for doc in site.docs %} - {% if doc.category == "getting-started" %} -
    • {{ doc.title }}
    • - {% endif %} + {% if doc.category == "getting-started" %} +
    • {{ doc.title }}
    • + {% endif %} {% endfor %}
    {% endraw %} ``` The result would be as follows: -
    +

    Getting Started

    @@ -521,31 +525,31 @@ Here's the code for getting lists of pages grouped under their corresponding cat {% for cat in mydocs %}

    {{ cat.name | capitalize }}

      - {% assign items = cat.items | sort: 'weight' %} - {% for item in items %} -
    • {{ item.title }}
    • - {% endfor %} + {% assign items = cat.items | sort: 'order' %} + {% for item in items %} +
    • {{ item.title }}
    • + {% endfor %}
    {% endfor %}{% endraw %} ``` **Result** -
    +

    Getting-started

    Configuration

    Deployment

    diff --git a/docs/_sass/_style.scss b/docs/_sass/_style.scss index 20264408..3a038966 100644 --- a/docs/_sass/_style.scss +++ b/docs/_sass/_style.scss @@ -1035,7 +1035,4 @@ code.output { .result { border: 1px solid yellow; padding: 10px; - margin-top: 10px; - margin-bottom: 10px; - font-size:14px; }