From 878ba1152ebc64a4a2609d23c9e400a6111db642 Mon Sep 17 00:00:00 2001 From: Agustin Henze Date: Wed, 27 Feb 2013 09:13:24 -0300 Subject: Imported Upstream version 5.3 --- nikola/plugins/task_render_listings.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'nikola/plugins/task_render_listings.py') diff --git a/nikola/plugins/task_render_listings.py b/nikola/plugins/task_render_listings.py index 6d1d853..a899f10 100644 --- a/nikola/plugins/task_render_listings.py +++ b/nikola/plugins/task_render_listings.py @@ -22,6 +22,8 @@ # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +from __future__ import unicode_literals, print_function + import os from pygments import highlight @@ -60,14 +62,16 @@ class Listings(Task): lineanchors=utils.slugify(f), anchorlinenos=True)) title = os.path.basename(in_name) - crumbs = out_name.split(os.sep)[1:-1] + [title] + print("CRUMBSINOUT", in_name, out_name) + #crumbs = out_name.split(os.sep)[1:-1] + [title] # TODO: write this in human - paths = ['/'.join(['..'] * (len(crumbs) - 2 - i)) for i in - range(len(crumbs[:-2]))] + ['.', '#'] + #paths = ['/'.join(['..'] * (len(crumbs) - 2 - i)) for i in + #range(len(crumbs[:-2]))] + ['.', '#'] + crumbs = utils.get_crumbs(os.path.relpath(out_name, kw['output_folder']), is_file=True) context = { 'code': code, 'title': title, - 'crumbs': zip(paths, crumbs), + 'crumbs': crumbs, 'lang': kw['default_lang'], 'description': title, } -- cgit v1.2.3