jekyll-maps icon indicating copy to clipboard operation
jekyll-maps copied to clipboard

How to: named locations from _data/...

Open jlconlin opened this issue 3 years ago • 0 comments

First of all, nice plugin! I really like it.

I have a data file with a few commonly used locations like:

# _data/places.yml
- title: "Office"
  location:
    latitude: ...
    longitude: ...
- title: "Home"
  location:
    latitude: ...
    longitude: ...

Instead of putting coordinates into my front matter, I would like to use these named locations like such:

_posts/2022-05-23-Named-Locations.md:

---
title: Post with named location
location: "Office"
---
Here is where I worked today:
{% google_map src="_data/places.yml" title={{ page.location }} %}

When I do that now, just get a map with markers for both my office and my home.

I suspect this is already possible, I'm just not sure how to apply the correct incantation to make it work.

jlconlin avatar May 25 '22 14:05 jlconlin