Original File grouped-archive.cshtml

ArchiveSources: posts/*
ArchiveKey: Colors
---
<p>
    This groups the archive using the "Colors" metadata property. Note how if <code>GroupKey</code> is defined for the document
    we can assume it's the index for a given color, but if it's not then it's the index for all colors.
</p>

@if (Model.ContainsKey(Keys.GroupKey))
{
    // An individual color
    <h3>@Model.GetString(Keys.GroupKey)</h3>
    @foreach (IDocument document in Model.GetChildren())
    {
        <h5>@Html.DocumentLink(document)</h5>
        <p><b>Colors:</b> @string.Join(", ", document.GetList<string>("Colors"))</p>
        @Html.Raw(document.GetString(Keys.Excerpt))
    }
}
else
{
    // The main color index
    <h3>All Colors</h3>
    @foreach (IDocument document in Model.GetChildren())
    {
        <h5>@Html.DocumentLink(document)</h5>
    }
}

This groups the archive using the "Colors" metadata property. Note how if GroupKey is defined for the document we can assume it's the index for a given color, but if it's not then it's the index for all colors.

Yellow

Pear

Colors: Green, Yellow

Pears are fruits produced and consumed around the world, growing on a tree and harvested in late Summer into October. The pear tree and shrub are a species of genus Pyrus /ˈpaɪrəs/, in the family Rosaceae, bearing the pomaceous fruit of the same name. Several species of pears are valued for their edible fruit and juices, while others are cultivated as trees.

Onion

Colors: Yellow, White

The onion (Allium cepa L., from Latin cepa "onion"), also known as the bulb onion or common onion, is a vegetable that is the most widely cultivated species of the genus Allium. Its close relatives include the garlic, scallion, shallot, leek, chive,[2] and Chinese onion.[3]

Banana

Colors: Yellow

A banana is an elongated, edible fruit – botanically a berry[1][2] – produced by several kinds of large herbaceous flowering plants in the genus Musa.[3] In some countries, bananas used for cooking may be called "plantains", distinguishing them from dessert bananas. The fruit is variable in size, color, and firmness, but is usually elongated and curved, with soft flesh rich in starch covered with a rind, which may be green, yellow, red, purple, or brown when ripe. The fruits grow in clusters hanging from the top of the plant. Almost all modern edible seedless (parthenocarp) bananas come from two wild species – Musa acuminata and Musa balbisiana. The scientific names of most cultivated bananas are Musa acuminata, Musa balbisiana, and Musa × paradisiaca for the hybrid Musa acuminata × M. balbisiana, depending on their genomic constitution. The old scientific name for this hybrid, Musa sapientum, is no longer used.