summaryrefslogtreecommitdiffstats
path: root/g2h/file_page.py
diff options
context:
space:
mode:
authorChristoph Schlosser <christoph@linux.com>2025-09-18 22:05:48 +0200
committerChristoph Schlosser <christoph@linux.com>2025-09-18 22:05:48 +0200
commit74cd345f76dd01034c804f75e7f16b42e9c0643c (patch)
treeb1105460df469168e052ec278bbb9b96a829ca33 /g2h/file_page.py
parentf2056d0a59cd7234610dd7da1ea2c3e2a4be0f00 (diff)
downloadgit2hugo-74cd345f76dd01034c804f75e7f16b42e9c0643c.tar.gz
g2h: Add breadcrumb navigations to file and tree pages
Diffstat (limited to 'g2h/file_page.py')
-rw-r--r--g2h/file_page.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/g2h/file_page.py b/g2h/file_page.py
index b154ee5..67ddf6d 100644
--- a/g2h/file_page.py
+++ b/g2h/file_page.py
@@ -2,7 +2,7 @@ import base64
import filetype
import os
-from .file import sanitize_file_name, tree_join
+from .file import generate_breadcrumbs, sanitize_file_name, tree_join
from .page import Page
from .tree import safe_join
@@ -37,6 +37,7 @@ class FilePage(Page):
content, file_type = bytes_to_content(file_bytes)
return {
+ 'breadcrumbs': generate_breadcrumbs(self.content_subdir, self.commit, os.path.join(self.file_path, self.file_name), self.tree.blobs),
'content': content,
'content_subdir': self.content_subdir,
'file_extension': os.path.splitext(self.file_name)[1].lstrip('.'),