diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/about.html | 13 | ||||
-rw-r--r-- | templates/repo_folder.html | 33 |
2 files changed, 33 insertions, 13 deletions
diff --git a/templates/about.html b/templates/about.html deleted file mode 100644 index 977d916..0000000 --- a/templates/about.html +++ /dev/null @@ -1,13 +0,0 @@ -<!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>{{ path }}</title> -</head> -<body> -{{ readme|markdown|safe }} -</body> -</html> 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> |