File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 99- name : Boston
1010 link : https://www.meetup.com/Jamstack-Boston/
1111 feed : https://api.meetup.com/Jamstack-Boston/events
12+ country : United States of America
1213
1314- name : Porto
1415 link : https://www.meetup.com/Jamstack-Porto/
Original file line number Diff line number Diff line change @@ -23,10 +23,15 @@ module.exports = {
2323 community : async function ( data ) {
2424 let community = data . community . filter ( e => true ) ;
2525 for ( let meetup of community ) {
26+ // skip if populated in the YAML file
27+ if ( meetup . country ) {
28+ continue ;
29+ }
30+
2631 // sry for await in loop
2732 let countryCode = await getCountryCode ( meetup . name ) ;
2833 if ( countryCode ) {
29- meetup . countryName = getCountryName ( countryCode ) ;
34+ meetup . country = getCountryName ( countryCode ) ;
3035 }
3136 }
3237
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ layout: layouts/base.njk
8080 <span class =" sr-only" >Country</span >
8181 <select data-filter-bind =" country" class =" text-black py-1 px-2 rounded-default border border-white bg-white" >
8282 <option selected value =" " >All Countries</option >
83- {%- for country in community | select (" countryName " ) | flatten | unique | sort (false , false ) %}
83+ {%- for country in community | select (" country " ) | flatten | unique | sort (false , false ) %}
8484 <option value =" {{ country | lower }}" >{{ country }} </option >
8585 {%- endfor %}
8686 </select >
@@ -98,7 +98,7 @@ layout: layouts/base.njk
9898 {# chose a pseudorandom theme based on the city name #}
9999 {% set theme = item .name .length % 4 %}
100100 <li
101- {%- if item.countryName %} data-filter-country =" {{ item.countryName | lower }}" {% endif %} >
101+ {%- if item.country %} data-filter-country =" {{ item.country | lower }}" {% endif %} >
102102 {{ meetup .card ( item .name , item .link , themes [theme ] ) }}
103103 </li >
104104 {%- endfor %}
You can’t perform that action at this time.
0 commit comments