Skip to content

Commit 97c4ae3

Browse files
committedApr 6, 2016
Update utils.py
1 parent 60e9b25 commit 97c4ae3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎nikola/utils.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -951,8 +951,10 @@ def get_crumbs(path, is_file=False, index_folder=None, lang=None):
951951
for i, crumb in enumerate(crumbs[-3::-1]): # Up to parent folder only
952952
_path = '/'.join(['..'] * (i + 1))
953953
_crumbs.append([_path, crumb])
954-
_crumbs.insert(0, ['.', crumbs[-2]]) # file's folder
955-
_crumbs.insert(0, ['#', crumbs[-1]]) # file itself
954+
if len(crumbs) >= 2:
955+
_crumbs.insert(0, ['.', crumbs[-2]]) # file's folder
956+
if len(crumbs) >= 1:
957+
_crumbs.insert(0, ['#', crumbs[-1]]) # file itself
956958
else:
957959
for i, crumb in enumerate(crumbs[::-1]):
958960
_path = '/'.join(['..'] * i) or '#'

0 commit comments

Comments
 (0)
Please sign in to comment.