Skip to content
Snippets Groups Projects
Commit bd66f0c9 authored by Lukas Ruge's avatar Lukas Ruge
Browse files

speed up 2

parent 66d469ae
No related branches found
No related tags found
No related merge requests found
Pipeline #15898 passed
{% assign events = site.events | where: "uid", video.event -%}
{% if video.event and video.event != '' -%}
{% for e in site.events -%}
{% for e in events -%}
{% if e.uid == video.event -%}
{% assign event = e -%}
{% endif -%}
......
......@@ -5,7 +5,7 @@
padding: 10px;
margin: 10px;">
{% assign events = site.events | where: "uid", {{ include.uid }} %}
{% assign events = site.events | where: "uid", {{ include.uid }} -%}
{% for event in events -%}
{% if event.uid contains {{include.uid}} -%}
......
{% assign projects = site.projects | where_exp: "project", "page.tags contains project.tag" -%}
{% for page_tag in page.tags-%}
{% for project in site.projects -%}
{% for project in projects -%}
{% if project.tag == page_tag -%}
<div style="
background-color: #fafafa;
......
......@@ -3,7 +3,8 @@
<h2 style="margin: 5px;">Weitere Artikel zu diesem Thema</h2>
</div>
<ul style="margin: 25px;">
{% for post in site.posts reversed %}
{% assign relevant_posts = site.posts | where_exp: "rpost", "rpost.tags contains include.topic" -%}
{% for post in relevant_posts reversed %}
{% if post.tags contains {{include.topic}} %}
<li>
<a href="{{ site.baseurl }}{{ post.url }}">{{post.title}}</a>
......
......@@ -27,7 +27,8 @@ Finding the first and last talk to establish the variables "earliest" and "lates
{% for video in conference_media -%}
{% if video.event and video.event != '' -%}
{% for e in site.events -%}
{% assign events = site.events | where: "uid", video.event -%}
{% for e in events -%}
{% if e.uid == video.event -%}
{% assign event = e -%}
{% endif -%}
......@@ -93,7 +94,8 @@ Finding the first and last talk to establish the variables "earliest" and "lates
{% capture recording_date %}{{v.recording_date }}{% endcapture -%}
{% assign dateArray = dateArray | push: recording_date -%}
{% elsif v.event and v.event != '' -%}
{% for e in site.events -%}
{% assign events = site.events | where: "uid", v.event -%}
{% for e in events -%}
{% if e.uid == v.event -%}
{% capture recording_date %}{{e.eventdate }}{% endcapture -%}
{% assign dateArray = dateArray | push: recording_date -%}
......@@ -112,7 +114,8 @@ Finding the first and last talk to establish the variables "earliest" and "lates
{% if v.recording_date and recording_date_s == date_s -%}
{% assign videoUidArray = videoUidArray | push: v.uid -%}
{% elsif v.event and v.event != '' -%}
{% for e in site.events -%}
{% assign events = site.events | where: "uid", v.event -%}
{% for e in events -%}
{% capture eventdate_s %}{{e.eventdate | date: '%s'}}{% endcapture -%}
{% if eventdate_s == date_s -%}
{% assign videoUidArray = videoUidArray | push: v.uid -%}
......@@ -140,6 +143,7 @@ Finding the first and last talk to establish the variables "earliest" and "lates
{% endif -%}
{% if video.event and video.event != '' -%}
{% assign events = site.events | where: "uid", video.event -%}
{% for e in site.events -%}
{% if e.uid == video.event -%}
{% assign event = e -%}
......@@ -184,7 +188,8 @@ Finding the first and last talk to establish the variables "earliest" and "lates
{% endif -%}
{% endif -%}
{% elsif event -%}
{% for post in site.posts -%}
{% assign posts = site.posts | where: "uid", event.uid -%}
{% for post in posts -%}
{% if post.uid == event.uid -%}
{% capture url %}https://chaotikum.org{{post.url}}{% endcapture -%}
{% assign eventpost = post -%}
......
......@@ -31,7 +31,8 @@ layout: default
</div>
<hr />
{% assign p = 0 -%}
{% for post in site.posts -%}
{% assign relevant_posts = site.posts | where_exp: "rpost", "rpost.tags contains page.tag" -%}
{% for post in relevant_posts -%}
{% if post.categories contains 'project' -%}
{% if post.tags contains page.tag -%}
{% assign p = p | plus: 1 -%}
......@@ -39,7 +40,7 @@ layout: default
{% endif -%}
{% endfor -%}
{% if p == 1 -%}
{% for post in site.posts -%}
{% for post in relevant_posts -%}
{% if post.categories contains 'project' -%}
{% if post.tags contains page.tag -%}
<h2>{{ post.title | markdownify | remove: '<p>' | remove: '</p>' }}</h2>
......@@ -48,7 +49,7 @@ layout: default
{% endif -%}
{% endfor -%}
{% else -%}
{% for post in site.posts -%}
{% for post in relevant_posts -%}
{% if post.categories contains 'project' -%}
{% if post.tags contains page.tag -%}
<time datetime="{{ post.date | date_to_xmlschema }}" class="time">{{ post.date | date_to_string }}</time>
......
......@@ -31,12 +31,14 @@ layout: default
{% endcapture -%}
{% if page.event and page.event != '' -%}
{% for e in site.events -%}
{% assign events = site.events | where: "uid", page.event -%}
{% for e in events -%}
{% if e.uid == page.event -%}
{% assign event = e -%}
{% endif -%}
{% endfor -%}
{% endif -%}
{% if page.recording_date and recording_date.event != ''-%}
{% assign recording_date = page.recording_date -%}
{% elsif event -%}
......
......@@ -26,11 +26,10 @@ layout: null
{% capture persons3 -%}{{whitespace}} von {{persons2}}{% endcapture -%}
{% assign events = site.events | where: "uid", video.event -%}
{% if video.event and video.event != '' -%}
{% for e in site.events -%}
{% if e.uid == video.event -%}
{% for e in events -%}
{% assign event = e -%}
{% endif -%}
{% endfor -%}
{% endif -%}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment