Skip to content

Commit fc4e41c

Browse files
committed
Add timeline view from ruby-conferences#579
1 parent 9a6a45e commit fc4e41c

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

Diff for: _layouts/default.html

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ <h1><a class="extruded" href="/"><span>Javascript&nbsp;</span><span>Conferences<
2323
<li class="{% if page.url == "/" %}active{% endif %}"><a href="/">Upcoming</a></li>
2424
<li class="{% if page.url == "/past/" %}active{% endif %}"><a href="/past/">Past</a></li>
2525
<li class="{% if page.url == "/cfp/" %}active{% endif %}"><a href="/cfp/">CFP</a></li>
26+
<li class="{% if page.url == "/timeline/" %}active{% endif %}"><a href="/timeline/">Timeline</a></li>
2627
</ul>
2728
</nav>
2829
</header>

Diff for: timeline/index.html

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
layout: default
3+
---
4+
5+
<article id="home">
6+
<pre class="mermaid">
7+
gantt
8+
dateFormat YYYY-MM-DD
9+
10+
{% assign beginningOfYear = site.time | date: "%Y-01-01" | date: '%s' | plus: 0 -%}
11+
{% assign now = site.time | date: '%s' | plus: 0 -%}
12+
{% assign conferences = site.data.conferences | sort: "start_date" -%}
13+
{%- for event in conferences -%}
14+
{% assign start_date = event.start_date | date: '%s' | plus: 0 -%}
15+
{%- assign dateStart = event.start_date | date: '%s' -%}
16+
{%- assign dateEnd = event.end_date | date: '%s' -%}
17+
{%- assign diffSeconds = dateEnd | minus: dateStart -%}
18+
{%- assign diffDays = diffSeconds | divided_by: 3600 | divided_by: 24 | at_least: 1 %}
19+
{%- if start_date >= beginningOfYear %}
20+
{{ event.name | replace: "#", "#35;" | replace: ":", "#58;" }} {% if start_date >= now %}:active{% else %}:done{%endif%}, {{ event.name | slugify: "ascii" | replace: "-", "" }}, {{ event.start_date | date: '%Y-%m-%d' }}, {{ diffDays }}d
21+
{%- endif -%}
22+
{% endfor %}
23+
24+
{% for event in conferences -%}
25+
{% assign start_date = event.start_date | date: '%s' | plus: 0 -%}
26+
{%- if start_date >= beginningOfYear %}
27+
click {{ event.name | slugify: "ascii" | replace: "-", "" }} href "{{ event.url }}"
28+
{%- endif -%}
29+
{% endfor -%}
30+
</pre>
31+
32+
<script type="module">
33+
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
34+
mermaid.initialize({
35+
theme: 'neutral',
36+
themeVariables: {
37+
sectionBkgColor: 'rgba(153, 153, 153, 0)',
38+
}
39+
});
40+
</script>
41+
</article>

0 commit comments

Comments
 (0)