diff --git a/source/_patterns/04-components/timeline/timeline.twig b/source/_patterns/04-components/timeline/timeline.twig index a71b9f6d3c8a6affe152492501c9b4abd61477b4..c6b2f86ddf420cc8ab2ba2b0d6f767e3398dabf6 100644 --- a/source/_patterns/04-components/timeline/timeline.twig +++ b/source/_patterns/04-components/timeline/timeline.twig @@ -2,16 +2,6 @@ uw-timeline vertical-timeline vertical-{{ style }} {{ modifier_classes }} {%- endset %} -{#{% for year, timeline_item in timeline_items %}#} -{# {{ year }}#} -{# {% for month, entries in timeline_item %}#} -{# {{ month }}#} -{# {% for entry in entries %}#} -{# {{ entry.headline }}#} -{# {% endfor %}#} -{# {% endfor %}#} -{#{% endfor %}#} - <ol class="{{ modifier_classes }}"> {% for year, timeline_item in timeline_items %} @@ -23,7 +13,9 @@ {% if style == 'month' %} <li> - <span class="timeline-month">{{ month }}</span> + {% set date = year ~ "-" ~ month ~ "-1" %} + + <span class="timeline-month">{{ date|date("M") }}</span> <ol> {% endif %} diff --git a/source/_patterns/04-components/timeline/timeline.yml b/source/_patterns/04-components/timeline/timeline.yml index be7765e264c929e26b1276aece3275376cda0204..e4a59fd667158e65c0b23046830a1c3e7bae540b 100644 --- a/source/_patterns/04-components/timeline/timeline.yml +++ b/source/_patterns/04-components/timeline/timeline.yml @@ -1,8 +1,8 @@ --- -style: 'year' +style: 'month' timeline_items: 1966: - jun: + 6: - headline: 'June 8, 1966' content: 'The Polyphemus moths have begun to emerge from their cocoons - 7 females and 2 males emerge in one day. I put the females into 3 separate mating boxes and leave them by an open window so that they can release their pheromones. By 1 am, they have called in a couple of male moths. I mate two of the females with wild males.' @@ -23,7 +23,7 @@ timeline_items: content: 'Successfully mated a Cecropia moth at 2:40 am on June16th, and over the next 2 days she laid 153 eggs into a paper bag. However, she presented odd behaviour while laying eggs, and laid thick bundles of 10-20 eggs on her legs rather than on the bag. Usually a female will lay groups of 3 eggs randomly, and never on her own body. I removed them from her and pulled apart the eggs before the substrate used to stick eggs to leaves completely dried. However I do not know if I have accidentally damaged any eggs in the process, despite my carefulness. This will be interesting to observe once the caterpillars begin to hatch in 10-14 days. ' image: 'https://uwaterloo.ca/ecology-lab/sites/ca.ecology-lab/files/styles/thumbnail/public/june_16.jpg?itok=18idxfuY' - jul: + 7: - headline: 'June 8, 1966' content: 'The Polyphemus moths have begun to emerge from their cocoons - 7 females and 2 males emerge in one day. I put the females into 3 separate mating boxes and leave them by an open window so that they can release their pheromones. By 1 am, they have called in a couple of male moths. I mate two of the females with wild males.' @@ -43,7 +43,7 @@ timeline_items: headline: 'June 16 - 18, 1966' content: 'Successfully mated a Cecropia moth at 2:40 am on June16th, and over the next 2 days she laid 153 eggs into a paper bag. However, she presented odd behaviour while laying eggs, and laid thick bundles of 10-20 eggs on her legs rather than on the bag. Usually a female will lay groups of 3 eggs randomly, and never on her own body. I removed them from her and pulled apart the eggs before the substrate used to stick eggs to leaves completely dried. However I do not know if I have accidentally damaged any eggs in the process, despite my carefulness. This will be interesting to observe once the caterpillars begin to hatch in 10-14 days. ' image: 'https://uwaterloo.ca/ecology-lab/sites/ca.ecology-lab/files/styles/thumbnail/public/june_16.jpg?itok=18idxfuY' - aug: + 8: - headline: 'aug 8, 1966' content: 'The Polyphemus moths have begun to emerge from their cocoons - 7 females and 2 males emerge in one day. I put the females into 3 separate mating boxes and leave them by an open window so that they can release their pheromones. By 1 am, they have called in a couple of male moths. I mate two of the females with wild males.' @@ -65,7 +65,7 @@ timeline_items: image: 'https://uwaterloo.ca/ecology-lab/sites/ca.ecology-lab/files/styles/thumbnail/public/june_16.jpg?itok=18idxfuY' 1967: - Jan: + 1: - headline: 'Jan 8, 1967' content: 'The Polyphemus moths have begun to emerge from their cocoons - 7 females and 2 males emerge in one day. I put the females into 3 separate mating boxes and leave them by an open window so that they can release their pheromones. By 1 am, they have called in a couple of male moths. I mate two of the females with wild males.'