Skip to content

Commit

Permalink
Update program page
Browse files Browse the repository at this point in the history
Check for title, subject and abstract to make it more flexible.
  • Loading branch information
splattater committed Feb 8, 2024
1 parent b9d719f commit 38f31a3
Showing 1 changed file with 26 additions and 14 deletions.
40 changes: 26 additions & 14 deletions program.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,35 +39,47 @@
<ul>
{% for row in days %}
{% assign description = row.day | rdf_property: "dct:description", site.language %}
{% assign abstract = row.day | rdf_property: "schema:abstract", site.language %}

<li>
<div class="card">
<h2>
<a href="{{ row.day.render_path | relativize_url }}">
<span class="xl hideunderline">{{ row.day | rdf_property: "rdfs:label", site.language }}</span>
</a>
</h2>
{%- assign title =row.day | rdf_property: "dct:title", site.language -%}
{%- if title -%}
<p>{{ row.day | rdf_property: "dct:title", site.language }}</p>
{%- endif -%}
{% assign subject = row.day | rdf_property: "dct:subject" %}
{%- if subject -%}
<p class="dates">
<time ev="">
<strong class="highlighted x1">{{ row.day | rdf_property: "dct:subject" }}</strong><br/>
</time>
</p>
{% if description %}
{% assign sentences = description | split: ". " %}
{% if sentences.size > 2 %}
<p class="justify">
<small>{{ sentences | slice: 0, 2 | join: ". " }}. </small>
</p>
<details>
<summary>
<small>Show more</small>
</summary>
{%- endif -%}
{% if abstract %}
<p class="justify"><small>{{ abstract }}</small></p>
{% else %}
{% if description %}
{% assign sentences = description | split: ". " %}
{% if sentences.size > 2 %}
<p class="justify">
<small>{{ sentences | slice: 2, sentences.size | join: ". " }}</small>
<small>{{ sentences | slice: 0, 1 | join: ". " }}. </small>
</p>
</details>
{% else %}
<p class="justify"><small>{{ description }}</small></p>
<details>
<summary>
<small>Show more</small>
</summary>
<p class="justify">
<small>{{ sentences | slice: 1, sentences.size | join: ". " }}</small>
</p>
</details>
{% else %}
<p class="justify"><small>{{ description }}</small></p>
{% endif %}
{% endif %}
{% endif %}
</div>
Expand Down

0 comments on commit 38f31a3

Please sign in to comment.