This repository was archived by the owner on May 2, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,6 +33,11 @@ module.exports = function(eleventyConfig) {
3333 return posts . slice ( 0 , num ) ;
3434 } ) ;
3535
36+ eleventyConfig . addNunjucksFilter ( 'featuredEvent' , ( posts ) => {
37+ // return a featured event or the first one
38+ return posts . find ( ( { data } ) => data . featured ) || posts [ 0 ] ;
39+ } ) ;
40+
3641 // redirect collection
3742 eleventyConfig . addCollection ( 'redirects' , function ( collection ) {
3843 const redirs = collection . getAll ( ) . filter ( ( { data } ) => data . redirect_from ) ;
Original file line number Diff line number Diff line change @@ -3,14 +3,14 @@ layout: default
33isHome: true
44---
55
6- {% set post = collections .eventi | published | last %}
6+ {% set post = collections .eventi | published | reverse | featuredEvent %}
77<!-- Slider Start -->
88<section id =" slider" style =" background-image : url ({{ post.data.cover }} )" >
99 <div class =" container" >
1010 <div class =" row" >
1111 <div class =" col-xs-12" >
1212 <div class =" block" >
13- <p class =" sr-only" >Prossimo evento </p >
13+ <p class =" sr-only" >Evento in primo piano </p >
1414 <h1 class =" animated fadeInUp" >{{ post .data .title | upper }} </h1 >
1515 <div class =" animated fadeInUp buttons" >
1616 <p >
Original file line number Diff line number Diff line change @@ -35,7 +35,11 @@ collections:
3535 default : ' /eventi/{{ page.date | dateslug }}/{{ page.fileSlug | slug }}/index.html'
3636 - widget : boolean
3737 name : published
38- label : Pubblicato
38+ label : Visibile
39+ default : false
40+ - widget : boolean
41+ name : featured
42+ label : In Primo Piano (Hero)
3943 default : false
4044 - widget : object
4145 name : event
You can’t perform that action at this time.
0 commit comments