From 7620dd41ca41cf4fb445d6a6e9afe2607ed77a95 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Thu, 22 Apr 2021 06:44:04 -0600 Subject: actually handle subfolders --- templates/about.html | 13 ------------- templates/repo_folder.html | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 13 deletions(-) delete mode 100644 templates/about.html create mode 100644 templates/repo_folder.html (limited to 'templates') 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 @@ - - - - - - - {{ path }} - - -{{ readme|markdown|safe }} - - 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 @@ + + + + + + + {{ title }} + + +

gityeet

+

{{ rel_path }}

+{%- 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 -%} + +{% 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 %} + + -- cgit v1.2.3