{% 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 }}scraps/{{ scrap.html_file_name }}" />
{% 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 }}tags/{{ tag.slug }}.html"><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.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 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 %}