{% extends "base.html.j2" %}


{% macro make_link(link) %}
    {{ link.rel }} [
                page: <a href="/pages{{ link.href }}">/pages{{ link.href }}</a> |
                API: <a href="{{ link.href }}">{{ link.href }}</a> ]
    <a href="{{ href }}">{{ rel }}</a>
{% endmacro %}

{% block title %}{meta.path}{% endblock %}

{% block content %}
    <h1>Meta</h1>
        <pre>
{{ response.meta }}
        </pre>

    <h1>Links</h1>
    <ul>
        {% for link in response.links %}
            <li> {{ make_link(link) }} </li>
        {% endfor %}
    </ul>

    {% if response.items != None and response["items"] != None %}
    <h1>Items</h1>
    <ul>
    {% for item in response["items"]  %}
        <li>
            {{ item.name }}
            {% for link in item.links %}
                {{ make_link(link) }}
            {% endfor %}
                HTML: {{ item.html | safe }}
        </li>
    {% endfor %}
    {%  endif %}
    <h1>Data</h1>
        <pre>
{{ response.data }}
        </pre>
{% endblock %}