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 ++++++++++++-------- src/main.scss | 23 ++++++++++++++--------- tmpl/page.atom.erb | 4 ++-- tmpl/page.html.erb | 2 +- 4 files changed, 29 insertions(+), 20 deletions(-) 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 diff --git a/src/main.scss b/src/main.scss index e143892..9a75c62 100644 --- a/src/main.scss +++ b/src/main.scss @@ -7,21 +7,26 @@ header { width: 100%; h1 { - font-size: 50px; margin: 0; background-color: rgba(0, 0, 0, 0.6); - color: white; padding: 4px; padding-bottom: 0; - } - p.breadcrumbs { - background-color: rgba(0, 0, 0, 0.6); - margin: 0; - color: white; - padding: 4px; + text-align: middle; + a:first-child { + font-size: 50px; + color: white; + } + &, a:not(:first-child) { + color: white; + font-size: 15px; + color: white; + } a { - color: GoldenRod; + text-decoration: none; + } + a:hover, a:focus { + text-decoration: underline; } } diff --git a/tmpl/page.atom.erb b/tmpl/page.atom.erb index d690974..e4957e3 100644 --- a/tmpl/page.atom.erb +++ b/tmpl/page.atom.erb @@ -6,6 +6,6 @@ <%= atom_title %> <%= atom_author.atom %> <% atom_categories.each do |c| %><%= c.atom %><% end %> - <% if atom_content %><%= SiteUtil::html_escape(atom_content) %><% end %> - <% if atom_rights %><%= SiteUtil::html_escape(atom_rights) %><% end %> + <% if atom_content %><%= Sitegen::html_escape(atom_content) %><% end %> + <% if atom_rights %><%= Sitegen::html_escape(atom_rights) %><% end %> diff --git a/tmpl/page.html.erb b/tmpl/page.html.erb index 504dbcb..5dc95ea 100644 --- a/tmpl/page.html.erb +++ b/tmpl/page.html.erb @@ -9,7 +9,7 @@
-

<%= SiteUtil::breadcrumbs(url) %>

+

<%= Sitegen::breadcrumbs(url) %>