<commit_before>{% include "snippetMacros.html" %}

{% macro renderMapLocations(items, pageUrl, classname) %}
  {% if items %}
    {% for item in items %}
      {{ renderMapLocation(item, pageUrl, classname) }}
    {% endfor %}
  {% else %}
    <h4>There are no map locations yet.</h4>
  {% endif %}
{% endmacro %}

{% macro renderMapLocation(item, pageUrl, classname) %}
  <li class="apos-location {{classname}} {% for tag in item.tags %} {{ tag | replace(' ','-') }}{% endfor %}" data-location-id="{{item._id}}">
    <a href="#">{{ item.title | e }}</a>
  </li>
{% endmacro %}

{% macro renderGoogleMap(mapItems, mapOptions={}) %}
  {% set _id = 'apos-map-canvas-' + aposGenerateId() %}
  <div class="apos-map-canvas" id="{{ _id }}"></div>

  {# load in the google maps apis #}
  {# instantiate a new AposGoogleMap #}
  <script type="text/javascript">
    $(function() {
      new AposGoogleMap({{ aposPruneMapLocations(mapItems) | json }}, {{ _id | json }}, {{ mapOptions | json }});
    });
  </script><commit_msg>Always generate a valid link to the place in the places menu, even if we plan to override that with javascript to show an infobox. Must be SEO-friendly.<commit_after>{% include "snippetMacros.html" %}

{% macro renderMapLocations(items, pageUrl, classname) %}
  {% if items %}
    {% for item in items %}
      {{ renderMapLocation(item, pageUrl, classname) }}
    {% endfor %}
  {% else %}
    <h4>There are no map locations yet.</h4>
  {% endif %}
{% endmacro %}

{% macro renderMapLocation(item, pageUrl, classname) %}
  <li class="apos-location {{classname}} {% for tag in item.tags %} {{ tag | replace(' ','-') }}{% endfor %}" data-location-id="{{item._id}}">
    {# Even if you plan to override this link with javascript, it still #}
    {# must exist, otherwise your maps are not Google-friendly. -Tom #}
    <a href="{{ item.url }}">{{ item.title | e }}</a>
  </li>
{% endmacro %}

{% macro renderGoogleMap(mapItems, mapOptions={}) %}
  {% set _id = 'apos-map-canvas-' + aposGenerateId() %}
  <div class="apos-map-canvas" id="{{ _id }}"></div>

  {# load in the google maps apis #}
  {# instantiate a new AposGoogleMap #}
  <script type="text/javascript">
    $(function() {
      new AposGoogleMap({{ aposPruneMapLocations(mapItems) | json }}, {{ _id | json }}, {{ mapOptions | json }});
    });
  </script>
{'fraction_non_alphanumeric': 0.19331333047578225, 'fraction_numerical': 0.0017145306472353193, 'mean_word_length': 3.7246963562753037, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1836314', 'n_tokens_mistral': 827, 'n_tokens_neox': 763, 'n_words': 212}