{% extends "__builtins/base.html" %}
{% block status_left %}scraps / {% if scrap.ctx %}{{ scrap.ctx }}/{% endif %}{{ scrap.title }}{% endblock status_left %}
{% block head %}
<meta property="og:url" content="{{ base_url }}{{ scrap.url_path }}" />
{% if scrap.thumbnail %}
<meta property="og:image" content="{{ scrap.thumbnail }}" />
<meta name="twitter:image" content="{{ scrap.thumbnail }}" />
{% endif %}
{% endblock %}
{% block main %}
<div class="scrap">
{% if scrap_tags | length > 0 %}
<p class="tags">
{% for tag in scrap_tags %}
<a class="tag" href="{{ base_url }}{{ tag.url_path }}"><span class="syntax">#[[</span>{{ tag.title }}<span class="syntax">]]</span></a>
{% endfor %}
</p>
{% endif %}
{% if scrap.ctx %}
<h3 class="context">{{ scrap.ctx }}<span>/</span></h3>
{% endif %}
<h1 class="title">{{ scrap.title }}</h1>{% if scrap_type %}
<p class="type">type <a class="name" href="{{ base_url }}{{ scrap_type.url_path }}">{{ scrap_type.name }}</a></p>{% endif %}
{% if scrap.commited_ts %}
<p class="commited-date">
committed {{ scrap.commited_ts | date(format="%Y-%m-%d", timezone=timezone) }}
</p>
{% endif %}
<div class="content">
{% for element in scrap.content.elements %}{% if element.raw %}{{ element.raw | safe }}{% elif element.autolink %}{{ <link_card autolink={element.autolink} /> }}{% endif %}{% endfor %}
</div>
</div>
{% if sources | length > 0 %}
<section class="connections sources">
<p class="section-head">sources · {{ sources | length }}</p>
<ul class="source-list">
{% for source in sources %}
<li class="item">{% if source.href %}<a class="link" href="{{ source.href }}">{{ source.label }}</a>{% else %}{% if source.title %}<span class="title">{{ source.title }}</span> {% endif %}<span class="resource">{{ source.resource }}</span>{% endif %}</li>
{% endfor %}
</ul>
</section>
{% endif %}
{% if scrap_graph %}
<section class="connections graph">
<p class="section-head">neighbourhood</p>
{{ <scrap_graph graph={scrap_graph} base_url={base_url} center_title={scrap.title} /> }}
</section>
{% endif %}
{% if linked_scraps | length > 0 %}
<section class="connections">
<p class="section-head">backlinks · {{ linked_scraps | length }}</p>
{{ <scrap_links scraps={linked_scraps} base_url={base_url} /> }}
</section>
{% endif %}
{% if outbound_scraps | length > 0 %}
<section class="connections">
<p class="section-head">links · {{ outbound_scraps | length }}</p>
{{ <scrap_links scraps={outbound_scraps} base_url={base_url} /> }}
</section>
{% endif %}
{% endblock %}