DIYbiosphere / sphere

DIYbiosphere is an open-source project to collect Do-it-Yourself Biology (DIYbio) initiatives from all over the world
http://sphere.diybio.org
MIT License
89 stars 54 forks source link

[bug] empty yml fields breaks build #273

Open 100ideas opened 4 years ago

100ideas commented 4 years ago

see https://github.com/DIYbiosphere/sphere/issues/256#issuecomment-544466378


The build failures on netlify seem to have been caused by the jekyll-algolia plugin getting empty _geoloc.lat or _geoloc.lng fields on an entry (see bottom of this build log).

3:47:32 AM: [jekyll-algolia] Error:                                                          
3:47:32 AM: 400: Cannot POST to https://ITI5JHZJM9.algolia.net/1/indexes/*/batch:            
3:47:32 AM: {"message":"_geoloc.lat or _geoloc.lng attributes cannot be null near line:1     
3:47:32 AM: column:13786","status":400} (400)  

I think this file was the problem:

I removed the empty fields and the build succeeded:

now lets see if merging staging to master results in a good build...


I just mreged staging into master #272 and it seems to have worked.

https://app.netlify.com/sites/diybiosphere/deploys/5dad8fefc3371300081a40a1

so, going forward, just comment out any empty fields in the yml frontmatter.

good

#BASIC INFO
title: Cell Eleven
subtitle: Democratized Biotech
type-org: startup
#LOCATION
# address: # street and number
city: Philadelphia
state: Pennsylvania
postcode: 19135
country: United States
# _geoloc: # Geolocation coordinates for mapping
#  lat: # latitude number
#  lng: # longitude number
---

bad

---
#BASIC INFO
title: Cell Eleven
subtitle: Democratized Biotech
type-org: startup
#LOCATION
address: 
city: Philadelphia
state: Pennsylvania
postcode: 19135
country: United States
_geoloc: # Geolocation coordinates for mapping
  lat: # WARNING THIS IS BLANK AND WILL BREAK BUILD # latitude number
  lng: # WARNING THIS IS BLANK AND WILL BREAK BUILD # longitude number
---
danwchan commented 3 years ago

I think some sort of sanity check implementation on the Netify side can be implemented to fix this issue moving forward