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