aboutsummaryrefslogtreecommitdiff
path: root/templates/repo_folder.html
blob: 81f455f7c5da00def5d90b99d5200bad07b9e6df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>{{ title }}</title>
</head>
<body>
<h1><a href="/">gityeet</a></h1>
<h2><a href="/{{ repo_path }}/">{{ repo_path }}</a></h2>
<p>{{ rel_path }}</p>
{%- macro effective_name(entry) -%}
    {{- entry.name().unwrap() -}}
    {%- match entry.kind() -%}
        {%- when Some with (x) %}{% match x %}{% when git2::ObjectType::Tree %}/{% else %}{% endmatch %}
        {%- else -%}
    {%- endmatch -%}
{%- endmacro -%}
<ul>
    {% for entry in tree -%}
    <li><a href="/{{ repo_path }}/tree{{ rel_path }}{% call effective_name(entry) %}">
        {%- call effective_name(entry) -%}
    </a></li>
    {%- endfor %}
</ul>
{% for entry in tree -%}
{% if entry.name().unwrap() == "README.md" -%}
{{ entry.to_object(repo).unwrap().into_blob().unwrap().content()|from_utf8_lossy|markdown|safe }}
{%- endif %}
{%- endfor %}
</body>
</html>