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

Commit

Permalink
Merge pull request #94 from Spirosvw/dynaminc-data
Browse files Browse the repository at this point in the history
Dynamic data in front page
  • Loading branch information
Constantine Xipolitopoulos authored Apr 14, 2020
2 parents 578062c + 3dfd9b6 commit 4b6f0a4
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 16 deletions.
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>



0 comments on commit 4b6f0a4

Please sign in to comment.