Jekyll - Google 地图服务器 API 未显示正确的地址

Jekyll - Google Maps Server API not displaying correct address

我正在使用 Jekyll 为朋友开发个人网页,我想包含一个动态 google maps 为了找地方!所以我的 _config.yml 是这样的:

address: Themistokleous 64 Athens 106 81 Greece

但是地址在网站上显示不正确..有人知道我应该如何输入地址吗??提前致谢

这是我在 github 上的代码:https://github.com/kavouras-rempetika/kavouras-rempetika.github.io

您的 q={% for address in site.address %}{{ address.line }},{% endfor %} 引用了一个不存在的配置变量。

您的_config.yml中当前可用的变量是:

location: Athens Greece
address: Themistokleous 64 

所以,你可以这样做:

q={{ site.address }},{{ site.location }}

完整的 iframe 是:

<iframe id="map_iframe"
    width="100%"
    height="100%"
    frameborder="0"
    scrolling="no"
    marginheight="0"
    marginwidth="0"
    src="https://maps.google.com/maps/embed/v1/place?key={{ site.google_api_key }}&q={{ site.address }},{{ site.location }}"
    allowfullscreen>
  </iframe>