<ul class="related-pages">
  {% for related_path, score in related_pages %}
    {% set related = grav['pages'].get(related_path) %}
    {% if related %}
      <li>
        <a href="{{ related.url }}" title="{{ related.title }}">{{ related.title }}</a>
        {% if config.plugins.relatedpages.show_score %}
          <span class="score">( {{ score }} )</span>
        {% endif %}
      </li>
    {% endif %}
  {% endfor %}
</ul>
