diff options
Diffstat (limited to 'templates/repo_folder.html')
-rw-r--r-- | templates/repo_folder.html | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/templates/repo_folder.html b/templates/repo_folder.html new file mode 100644 index 0000000..6f6b3a9 --- /dev/null +++ b/templates/repo_folder.html @@ -0,0 +1,33 @@ +<!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> +<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> |