Original File computed-grouped-archive.cshtml
ArchiveSources: posts/*
ArchiveKey: => GetDateTime("PostDate").ToString("MMMM")
---
<p>
This groups the archive using a computed value to get the "PostDate" month. 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 month
<h3>@Model.GetString(Keys.GroupKey)</h3>
@foreach (IDocument document in Model.GetChildren())
{
<h5>@Html.DocumentLink(document)</h5>
<p><b>Post Date:</b> @document.GetString("PostDate")</p>
@Html.Raw(document.GetString(Keys.Excerpt))
}
}
else
{
// The main month index
<h3>All Months</h3>
@foreach (IDocument document in Model.GetChildren())
{
<h5>@Html.DocumentLink(document)</h5>
}
}
This groups the archive using a computed value to get the "PostDate" month. 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.
August
Orange
Post Date: 8/24/2018
The orange is the fruit of various citrus species in the family Rutaceae (see list of plants known as orange); it primarily refers to Citrus × sinensis,[1] which is also called sweet orange, to distinguish it from the related Citrus × aurantium, referred to as bitter orange. The sweet orange reproduces asexually (apomixis through nucellar embryony); varieties of sweet orange arise through mutations.[2][3][4][5]
Mango
Post Date: 8/13/2018
A mango is a stone fruit produced from numerous species of tropical trees belonging to the flowering plant genus Mangifera, cultivated mostly for their edible fruit. Most of these species are found in nature as wild mangoes. The genus belongs to the cashew family Anacardiaceae. Mangoes are native to South Asia,[1][2] from where the "common mango" or "Indian mango", Mangifera indica, has been distributed worldwide to become one of the most widely cultivated fruits in the tropics. Other Mangifera species (e.g. horse mango, Mangifera foetida) are grown on a more localized basis.