summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2017-01-09 17:27:26 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2017-01-09 17:27:26 -0500
commitf582680627713f2b67c8506b4e3692d25b742298 (patch)
tree19fb135ba6b9bc000ac670acaaa3db1bcad4d08b
parenta70b39250252962df17670cee743d01d1a6f7c16 (diff)
fix
-rw-r--r--lib/siteutil.rb20
-rw-r--r--src/main.scss23
-rw-r--r--tmpl/page.atom.erb4
-rw-r--r--tmpl/page.html.erb2
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('&', '&amp;')
@@ -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("<a href=\"#{u}\">#{File::basename(u, File::extname(u))}</a>")
- u = File::dirname(u)
+ while true
+ a = 'out'+path
+ b = ('out'+path+'/index.html').gsub('//', '/')
+ page = @mk[a] || @mk[b]
+ bc.unshift("<a href=\"#{url.route_to(page.url)}\">#{page.atom_title}</a>")
+ break if path == "/"
+ path = File::dirname(path)
end
- bc.unshift("<a href=\"/\">Andrew D. Murrell</a>")
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 @@
<title><%= atom_title %></title>
<author><%= atom_author.atom %></author>
<% atom_categories.each do |c| %><%= c.atom %><% end %>
- <% if atom_content %><content type="html"><%= SiteUtil::html_escape(atom_content) %></content><% end %>
- <% if atom_rights %><rights type="html"><%= SiteUtil::html_escape(atom_rights) %></rights><% end %>
+ <% if atom_content %><content type="html"><%= Sitegen::html_escape(atom_content) %></content><% end %>
+ <% if atom_rights %><rights type="html"><%= Sitegen::html_escape(atom_rights) %></rights><% end %>
</entry>
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 @@
</head>
<body class="<%= html_class %>">
<header>
- <h1 class=breadcrumbs><%= SiteUtil::breadcrumbs(url) %></h1>
+ <h1 class=breadcrumbs><%= Sitegen::breadcrumbs(url) %></h1>
<nav>
<ul>
<li><a href="/">Projects</a>