diff --git a/izanami/controller.py b/izanami/controller.py index 9f8a3cc..cbb149a 100644 --- a/izanami/controller.py +++ b/izanami/controller.py @@ -180,7 +180,11 @@ def blob(self, request): else None ) above = Path("/" + request.params['object']) / '../' - print(above.resolve()) + readme = None + if isinstance(data, git.objects.tree.Tree): + for blob in data: + if blob.name.startswith('README'): + readme = blob.data_stream.read().decode('utf-8') return Response.render(template, { 'repo': repo, 'current_head': head, @@ -189,7 +193,8 @@ def blob(self, request): 'name': request.params['object'], 'data': data, 'above': str(above.resolve()), - 'content': content + 'content': content, + 'readme': readme }) def commit(self, request): diff --git a/izanami/templates/repo/blob.html b/izanami/templates/repo/blob.html index cfa56b3..f59f907 100644 --- a/izanami/templates/repo/blob.html +++ b/izanami/templates/repo/blob.html @@ -25,7 +25,7 @@
{{ name }}
{% else %}
{{ name }}/
-