<ul class="related-pages">
    {% for related_path, score in related_pages %}
        {% set related = grav['pages'].get(related_path) %}
        {% if related %}
            {% if related.header.media == 'video' %}
            <li class="video">
            {% else %}
            <li class="text">
            {% endif %}
                {% 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>