1---2pagination:3 data: forge.pages.blobs4---5{% extends "base.njk" %}6{% import "macros.njk" as m with context %}7{% import "ui.njk" as ui %}8{% block scripts %}{% if p.blameHref and not p.markdown %}<script src="{{ assets.blame }}" defer></script>{% endif %}{% endblock %}9{% block content %}10{% css %}11.image-view { padding: var(--space-4); text-align: center; }12.image-view img { max-width: 100%; height: auto; }13/* Blame (blame.ts): a column before the line numbers, a band per run of14 lines from one commit; its first line names the commit and when. */15.code:not(.blamed) .bl { display: none; }16.code .bl { flex: none; width: 17ch; padding: 0 var(--space-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: var(--text-xs); color: var(--muted); border-right: var(--hairline) solid var(--border); background: var(--raised); }17.code .bl.alt { background: var(--tint); }18.code .bl.first { border-top: var(--hairline) solid var(--border); }19.code .bl a { color: var(--link); }20.code .bl time { font-size: inherit; color: var(--faint); }21@media (max-width: 480px) { .code .bl { width: 9ch; } .code .bl time { display: none; } }22.history { margin-bottom: var(--space-4); }23.history td.rv { white-space: nowrap; }24{% endcss %}25<div class="bar">{{ m.branches(p.repo, p.branch.name, 'tree') }}{{ m.crumbs(p.repo, p.branch.name, p.crumbs) }}</div>26{% set head %}27<span class="grow"><b class="mono">{{ p.path.split('/') | last }}</b> <span class="n">{{ p.size | size }}</span>{% if p.mode == '100755' %} executable{% endif %}</span>28<span class="end">{% if p.markdown %}<a href="{{ p.sourceHref }}">source</a>{% elif p.isSource %}<a href="{{ p.renderedHref }}">rendered</a>{% endif %}29{% if not p.markdown and not p.image %}{% if p.blameHref %}{{ ui.button('blame', false, 'data-blame aria-pressed="false" title="who last changed each line"') }}{{ ui.button('history', false, 'data-history aria-pressed="false" title="the commits that changed this file"') }}{% endif %}{{ ui.checkbox('wrap lines', false, 'data-wrap') }}{{ ui.button('copy', false, 'data-copy-code') }}{% endif %}</span>30{% endset %}31{% set battrs %}{% if p.blameHref and not p.markdown %}data-blame-src="{{ p.blameHref }}" data-commit-base="{{ p.commitBase }}" data-review-base="{{ p.reviewBase }}"{% endif %}{% endset %}32{% if p.blameHref and not p.markdown %}33{# The commits that changed the file (blame.ts fills it from blame.json). #}34<section class="panel history" id="history" hidden><header class="panel-head"><b>history</b><span class="grow"></span></header><table class="list nav"><tbody></tbody></table></section>35{% endif %}36{% call ui.panel(head, 'viewer', battrs) %}37{% if p.markdown %}<div class="markdown">{{ p | markdownHtml | safe }}</div>{% else %}{{ p | blobHtml | safe }}{% endif %}38{% endcall %}39{% endblock %}