Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

Dynamic front page feature row #94

Merged
6 commits merged into from
Apr 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions _includes/dynamic.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{% if include.index %}
{% assign i = include.index %}
{% endif %}

{% if include.id %}
{% assign f = site.[include.id][i] %}
{% endif %}

{% if include.category %}
{% assign cat = include.category %}
{% endif %}



<div class="feature__item">
<div class="archive__item">
<div class="archive__item-body">
{% if include.category %}
<h3>{{ cat }}</h3>
{% endif %}
<a href="{{ site.url }}{{ site.baseurl }}{{ site.[include.id][i].url }}">


{% if f.title %}
<h2 class="archive__item-title">{{ f.title }}</h2>
{% endif %}

</a>

{% if f.image_url %}
<div class="archive__item-teaser">
{% capture url %}{{ f.image_url }}{% endcapture %}
{% assign split_url = url | split: '.' %}
{% capture thumb_url %}{{split_url[0]}}-thumb.{{split_url[1]}}{% endcapture %}
<img src="{{ site.url }}{{ site.baseurl }}{{ thumb_url }}">
</div>
{% endif %}

{% if f.excerpt %}
<div class="archive__item-excerpt">
{{ f.excerpt | markdownify }}
</div>
{% endif %}

</div>
</div>
</div>
42 changes: 26 additions & 16 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,11 @@
caption:
excerpt: 'Η δράση του Τμήματος Πληροφορικής είναι προσανατολισμένη σε καινοτόμες εφαρμογές στις κατευθύνσεις των:<br /> <small><a href="/humanistic">Ανθρωπιστικών-Κοινωνικών Επιστημών </a></small><br /> <small><a href="/systems">Πληροφοριακών Συστημάτων </a></small><br /><br />'
feature_row:
- image_path: /assets/images/mm-customizable-feature.png
alt: "news"
title: "Ανακοινώσεις"
excerpt: "Ενημερωθείτε για τα τελευταία νέα του τμήματος Πληροφορικής."
url: "/posts/"
- url: "/posts/"
btn_label: "Learn More"
- image_path: /assets/images/mm-responsive-feature.png
alt: "projects"
title: "Ερευνητικά Προγράμματα"
excerpt: "Δείτε όλα τα ερευνητικά προγράμματα του τμήματος Πληροφορικής."
url: "/projects/"
- url: "/projects/"
btn_label: "Learn More"
- image_path: /assets/images/mm-free-feature.png
alt: "labs"
title: "Εργαστήρια"
excerpt: "Τα εργαστήρια του τμήματος παρέχουν έρευνα και διδασκαλία στην περιοχή της Πληροφορικής"
url: "/groups/"
- url: "/groups/"
btn_label: "Learn More"
github:
- excerpt: ''
Expand All @@ -35,6 +23,28 @@
---




{% include feature_row id="intro" type="center" %}

{% include feature_row %}
<div class="feature__wrapper">

{% assign random = site.time | date: "%s%N" | modulo: site.posts.size %}

{% include dynamic.html id="posts" category="Posts" index=random %}

{% assign random = site.time | date: "%s%N" | modulo: site.projects.size %}

{% include dynamic.html id="projects" category="Projects" index=random %}

{% assign random = site.time | date: "%s%N" | modulo: site.groups.size %}

{% include dynamic.html id="groups" category="Groups" index=random %}

{% include feature_row %}


<div>