Skip to content

Commit

Permalink
Komponenta pro "featured" preview dlaždice
Browse files Browse the repository at this point in the history
Umožňuje specifikovat pořadí, ve kterém se dlaždice mají zobrazit.
  • Loading branch information
mgrabovsky committed Jun 23, 2022
1 parent cbdb013 commit fbfa4d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 1 addition & 2 deletions collections/_pages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ slug: index
<div class="section tab-pane fade show active bg-extralight-blue pt-4 pb-4" id="tab1" role="tabpanel" aria-labelledby="tab-role-1"><div class="container">
<p class="lead mb-0">S extrémními meteorologickými událostmi se stále častěji objevuje otázka: „Byla tato událost způsobena změnou klimatu?“ Pro rychlé zorientování se v tématu doporučujeme infografiku shrnující to nejdůležitější, pro hlubší porozumění pak „Kompas pro novináře – extrémy počasí a klimatická změna. Jak o nich mluvit a psát“ a texty českých vědců k situaci v Česku.</p>
{% assign featured_slugs = "vliv-klimatu-na-extremy, vliv-klimatu-na-extremy-prirucka, vliv-klimatu-na-extremy-cesko, tropicke-dny-brno, souvislost-koncentrace-oteplovani, teplota-cr" | split: ", " %}
{% assign featured = site.documents | where_exp: "item", "'infographics, studies, explainers' contains item.collection" | where_exp: "item", "featured_slugs contains item.slug" %}
{% include preview-blocks.html blocks=featured limit=6 %}
{% include includes-local/preview-featured-blocks.html slugs=featured_slugs %}
<p class="lead">Vlivu klimatické změny na extrémy počasí se budeme věnovat i v průběhu léta, a to jak na webu, tak v podcastu 2050.</p>
<a href="https://2050podcast.cz/" class="btn btn-primary"><i class="fas fa-fw fa-headphones"></i> Podcast 2050</a>
<a href="/slovnik" class="btn btn-secondary"><i class="fas fa-fw fa-book"></i> Slovník pojmů</a>
Expand Down
12 changes: 12 additions & 0 deletions includes-local/preview-featured-blocks.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% if include.slugs %}
<div class="row justify-content-md">
{% for needle in include.slugs %}
{% assign item = site.infographics | concat: site.studies | concat: site.explainers | concat: site.episodes | find_exp:"item","item.slug == needle" %}
<div class="col-md-6 col-lg-4">
<a href="{{ item | get_url }}" class="preview-card card">
{% include preview-block.html item=item %}
</a>
</div>
{% endfor %}
</div>
{% endif %}

0 comments on commit fbfa4d4

Please sign in to comment.