Krolyxon
Commit 4e844bb

ferreniumtemplatesblob.html

43 lines · 1.9 KB · HTML

1{% extends "base.html" %}
2{% block content %}
3{% include "repo_nav.html" %}
4{% include "crumbs.html" %}
5<div class="blob-bar">
6 <p class="label blob-facts">{% for fact in facts %}{% if !loop.first %} · {% endif %}{{ fact }}{% endfor %}</p>
7 <div class="blob-actions">
8 {%- if let Some(toggle) = toggle %}
9 <nav class="segmented segmented-sm" aria-label="View">
10 <a href="{{ toggle.preview_url }}"{% if !toggle.source %} aria-current="true"{% endif %}>Preview</a>
11 <a href="{{ toggle.source_url }}"{% if toggle.source %} aria-current="true"{% endif %}>Source</a>
12 </nav>
13 {%- endif %}
14 <a class="btn-ghost" href="{{ raw_url }}">Raw</a>
15 <a class="btn-ghost" href="{{ log_url }}">History</a>
16 <a class="btn-ghost" href="{{ download_url }}">Download</a>
17 </div>
18</div>
19{%- match body %}
20{%- when Body::Code with { lines } %}
21<div class="code-wrap">
22<table class="code" data-lines>
23<tbody>
24{%- for line in lines.iter() %}
25<tr id="L{{ loop.index }}"><td class="ln"><a href="#L{{ loop.index }}">{{ loop.index }}</a></td><td class="lc">{{ line|safe }}</td></tr>
26{%- endfor %}
27</tbody>
28</table>
29</div>
30{%- when Body::Markdown with { html } %}
31<article class="markdown blob-markdown">{{ html|safe }}</article>
32{%- when Body::Image with { src } %}
33<figure class="image-view dot-grid"><img src="{{ src }}" alt="{{ here.as_deref().unwrap_or_default() }}"></figure>
34{%- when Body::Symlink with { target, url } %}
35<p class="blob-note"><span class="label">Symlink to</span> {% if let Some(url) = url %}<a class="mono" href="{{ url }}">{{ target }}</a>{% else %}<span class="mono">{{ target }}</span>{% endif %}</p>
36{%- when Body::Binary %}
37<p class="status blob-note">[Binary file]</p>
38{%- when Body::TooLarge %}
39<p class="status blob-note">[Too large to display] <a href="{{ raw_url }}">View raw</a></p>
40{%- when Body::Empty %}
41<p class="status blob-note">[Empty file]</p>
42{%- endmatch %}
43{% endblock %}