Simply converts all known readme naming conventions and file names
within the tree to lower case on file discovery. This ensures double the
coverage of acceptable readme filenames.
This patch is the result of a discussion over making the known readme
naming conventions extendable by the user on the Klaus mailing list.
[ See
https://groups.google.com/forum/#!topic/klaus-users/mXjDxyqbeMQ ]
---
klaus/views.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/klaus/views.py b/klaus/views.py
index 6fafdd1..abb2359 100644
--- a/klaus/views.py
+++ b/klaus/views.py
@@ -235,7 +235,7 @@ class IndexView(TreeViewMixin, BaseRepoView):
def _get_readme(self):
tree = self.context['repo'][self.context['commit'].tree]
for name in README_FILENAMES:
- if name in tree:
+ if name.lower() in [t.lower() for t in tree]:
readme_data = self.context['repo'][tree[name][1]].data
readme_filename = name
return (readme_filename, readme_data)
--
2.17.1