This repository has been archived by the owner on Mar 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add trailing slashes to URL re: #5 & improve readability of tempaltes.
- Loading branch information
1 parent
8c63e46
commit 35034a1
Showing
4 changed files
with
67 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<%inherit file="bf_base_template" /> | ||
% for posts in month_posts: | ||
%for posts in month_posts: | ||
<h1>${posts[0].date.strftime("%B %Y")}</h1> | ||
<ul> | ||
% for post in posts: | ||
<li><a href="${post.permapath()}">${post.title}</a></li> | ||
% endfor | ||
%for post in posts: | ||
<li><a href="${post.path}">${post.title}</a></li> | ||
%endfor | ||
</ul> | ||
% endfor | ||
%endfor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,49 @@ | ||
<header> | ||
<div id="header" class="header_gradient theme_font"> | ||
<h1><a href="${bf.util.site_path_helper()}">${bf.config.blog.name}</a></h1> | ||
<h1> | ||
<a href="${bf.util.site_path_helper(trailing_slash=True)}"> | ||
${bf.config.blog.name} | ||
</a> | ||
</h1> | ||
<h2>${bf.config.blog.description}</h2> | ||
</div> | ||
<div id="navigation" class="grid_12"> | ||
<% | ||
def nav_class(path): | ||
render_path = bf.template_context.render_path.rsplit("/index.html")[0] | ||
if render_path == path or (path == "/" and render_path == "."): | ||
return "selected" | ||
return "" | ||
%> | ||
<% | ||
def nav_class(path): | ||
render_path = bf.template_context.render_path.rsplit("index.html")[0] | ||
if path == "/" and render_path == "./": | ||
return "selected" | ||
elif render_path == path or "/" + render_path == path: | ||
return "selected" | ||
else: | ||
return "" | ||
%> | ||
<% | ||
def blog_nav_class(): | ||
render_path = bf.template_context.render_path | ||
if render_path.startswith("/blog/") and "archive" not in render_path: | ||
return "selected" | ||
return "" | ||
%> | ||
<ul class="theme_font"> | ||
<li><a href="${bf.util.site_path_helper()}" | ||
class="${nav_class(bf.util.site_path_helper())}">Home</a></li> | ||
<li><a href="${bf.util.site_path_helper(bf.config.blog.path)}" | ||
class="${nav_class(bf.util.site_path_helper(bf.config.blog.path))}">Blog</a></li> | ||
<li><a href="${bf.util.site_path_helper(bf.config.blog.path,'archive')}" | ||
class="${nav_class(bf.util.site_path_helper(bf.config.blog.path,'archive'))}">Archives</a></li> | ||
<li> | ||
<% path = bf.util.site_path_helper(trailing_slash=True) %> | ||
<a href="${path}" class="${nav_class(path)}">Home</a> | ||
</li> | ||
<li> | ||
<% | ||
path = bf.util.site_path_helper( | ||
bf.config.blog.path) | ||
%> | ||
<a href="${path}" class="${blog_nav_class()}">Blog</a> | ||
</li> | ||
<li> | ||
<% | ||
path = bf.util.site_path_helper( | ||
bf.config.blog.path, "archive", trailing_slash=True) | ||
%> | ||
<a href="${path}" class="${nav_class(path)}">Archives</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</header> |