From f582680627713f2b67c8506b4e3692d25b742298 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 9 Jan 2017 17:27:26 -0500 Subject: fix --- lib/siteutil.rb | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/siteutil.rb b/lib/siteutil.rb index 2b4eda7..3f36ff2 100644 --- a/lib/siteutil.rb +++ b/lib/siteutil.rb @@ -1,6 +1,8 @@ # coding: utf-8 +require 'config' +require 'sitegen' -module SiteUtil +module Sitegen def self.html_escape(html) html .gsub('&', '&') @@ -9,15 +11,17 @@ module SiteUtil end def self.breadcrumbs(url) - # TODO + path = url.path + path = "/" if path == "" bc = [] - u = url.path - u = "/" if u == "" - while u != "/" - bc.unshift("#{File::basename(u, File::extname(u))}") - u = File::dirname(u) + while true + a = 'out'+path + b = ('out'+path+'/index.html').gsub('//', '/') + page = @mk[a] || @mk[b] + bc.unshift("#{page.atom_title}") + break if path == "/" + path = File::dirname(path) end - bc.unshift("Andrew D. Murrell") return bc.join(' ยป ') end end -- cgit v1.2.3