Merge pull request #24 from matze/fix-breadcrumb

Fix breadcumb -> breadcrumb
This commit is contained in:
Simon Conseil
2013-07-30 12:48:04 -07:00
3 changed files with 10 additions and 10 deletions

View File

@@ -41,9 +41,9 @@
<div id="main" role="main" class="twelve columns offset-by-four">
<header>
{% if breadcumb %}
{% if breadcrumb %}
<h2>
{%- for url, title in breadcumb -%}
{%- for url, title in breadcrumb -%}
<a href="{{ url }}">{{ title }}</a>
{%- if not loop.last %} » {% endif -%}
{% endfor -%}

View File

@@ -31,9 +31,9 @@
</nav>
{% endif %}
{% if breadcumb %}
{% if breadcrumb %}
<h2>
{%- for url, title in breadcumb -%}
{%- for url, title in breadcrumb -%}
<a href="{{ url }}">{{ title }}</a>
{%- if not loop.last %} » {% endif -%}
{% endfor -%}

View File

@@ -101,7 +101,7 @@ class Writer(object):
'theme': {'name': os.path.basename(self.theme)},
'medias': [],
'albums': [],
'breadcumb': ''
'breadcrumb': ''
}
def copy_assets(self):
@@ -110,11 +110,11 @@ class Writer(object):
self.theme_path = os.path.join(self.output_dir, 'static')
copy_tree(os.path.join(self.theme, 'static'), self.theme_path)
def get_breadcumb(self, paths, relpath):
def get_breadcrumb(self, paths, relpath):
"""Paths to upper directories (with titles and links)."""
tmp_path = relpath
breadcumb = [((self.url_ext or '.'), paths[tmp_path]['title'])]
breadcrumb = [((self.url_ext or '.'), paths[tmp_path]['title'])]
while True:
tmp_path = os.path.normpath(os.path.join(tmp_path, '..'))
@@ -122,9 +122,9 @@ class Writer(object):
break
url = os.path.relpath(tmp_path, relpath) + '/' + self.url_ext
breadcumb.append((url, paths[tmp_path]['title']))
breadcrumb.append((url, paths[tmp_path]['title']))
return reversed(breadcumb)
return reversed(breadcrumb)
def generate_context(self, paths, relpath):
"""Generate the context dict for the given path."""
@@ -142,7 +142,7 @@ class Writer(object):
ctx['theme']['url'] = os.path.relpath(self.theme_path, path)
if relpath != '.':
ctx['breadcumb'] = self.get_breadcumb(paths, relpath)
ctx['breadcrumb'] = self.get_breadcrumb(paths, relpath)
for i in paths[relpath]['medias']:
media_ctx = {}