Skip to content

Latest commit

 

History

History
67 lines (58 loc) · 2.33 KB

timeline.md

File metadata and controls

67 lines (58 loc) · 2.33 KB
layout title permalink
page
Date di morte
/date_di_morte/
<script src="https://cdn.knightlab.com/libs/timeline3/latest/js/timeline-min.js"></script> <script> function decodeHTML(encoded) { var elem = document.createElement('textarea'); elem.innerHTML = encoded; var decoded = elem.value; return decoded; } var date_morte= { "title": { /* "media": { // "url": "//www.flickr.com/photos/tm_10001/2310475988/", // "caption": "Whitney Houston performing on her My Love is Your Love Tour in Hamburg.", // "credit": "flickr/tm_10001" }, */ "text": { "headline": "Caduti Centesi
della Grande Guerra", "text": "" } }, "events": [ {% assign filtereddata = site.data.caduti | where_exp:"member", "member.Data_morte" | sort: "Data_morte" %} {% assign cadutoMinDataMorte = filtereddata | first %} {% assign cadutoMinDataMorte = filtereddata | last %} {% for member in filtereddata %} {% assign dataMorte = member.Data_morte | split: '-' %} { "start_date": { "month": "{{dataMorte[1] | plus:0}}", "day": "{{dataMorte[2] | plus:0}}", "year": "{{dataMorte[0]}}" }, "text": { "headline": '{{member.Cognome}} {{member.Nome}}', {% capture member_text %}

Nato a {{member.Luogo_nascita}}{%if member.Data_nascita %} nel {{member.Data_nascita | round}}{% endif %}{% if member.Data_morte %},
morto {%if dataMorte[2] == "11" %}l'{%else%}il {%endif%}{{dataMorte[2]}}/{{dataMorte[1]}}/{{dataMorte[0]}}{% endif %}

{% endcapture %} {% assign member_text = member_text | xml_escape %} "text": decodeHTML("{{member_text}}") } }, {% endfor %} ] }; console.log(date_morte['events'][0]); </script>
<script> var timeline_options={ hash_bookmark: true, language: "it", timenav_height_percentage: 50 }; window.timeline = new TL.Timeline('timeline-embed', date_morte, timeline_options); </script>