jekyll-maps
jekyll-maps copied to clipboard
Help please
I am trying to use your plugin on a jekyll site using a yml data file that also serves other purposes. Anyway, I can't get the gem to pull in the title field. It just pulls in a "null". even though one of the fields is named "title" (ideally I would be able to remap the names of the fields). I have tried adding a "location:" to the beginning of the record and indenting everything else by two spaces. It does pull in the lat, long and url just fine. Also is there a way to use advanced logic for the marker image (i.e., if type=sweet then use marker one if type=savory then use marker 2)? Ideally, I would love to see live use cases out there including sample yml files beyond what you have in ayastreb.me/jekyll-maps/ If anyone can lead me in the right direction.... Thanks!
Please disregard the first part, I have been able to get the titles to come through. I think the biggest thing I am looking for is the ability to use logic on a data file.
Imagine a dataset like:
- location: Tastes: Sweet Title: Los Angeles Latitude: 50.0000 Longitude: 50.0000
- location: Tastes: Savory Title: New York Latitude: 50.0000 Longitude: 50.0000
Effectively, I want to do something like {% google_map src="_data/dataset.yml" marker1=(Tastes=Sweet) marker2=(Tastes=Savory) marker_icon_1=sweet.png marker_icon_2=savory.png %}. The very manual way to do it would be to do a find replace in the dataset to add marker_icon=sweet.png to all of the tastes:sweet but that is not elegant. I guess I could also pre-process the datafile into a 2nd datafile where I somehow automated that, but that may be beyond my abilities if that can even be done in jekyll.