Skip to content

Commit

Permalink
add breadcrumbs, tidy up CSS, make code stand out
Browse files Browse the repository at this point in the history
  • Loading branch information
pdurbin committed Mar 7, 2012
1 parent c019078 commit e4d2615
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 6 deletions.
2 changes: 2 additions & 0 deletions _includes/breadcrumbs-begin.html
@@ -0,0 +1,2 @@
<div id="bread">
<ul>
2 changes: 2 additions & 0 deletions _includes/breadcrumbs-end.html
@@ -0,0 +1,2 @@
</ul>
</div>
56 changes: 56 additions & 0 deletions _includes/breadcrumbs.html
@@ -0,0 +1,56 @@
{% include breadcrumbs-begin.html %}

{% assign url = {{page.url}} %}
{% assign delimiter = '/' %}
{% capture allparts %}{{ url | replace: delimiter, ' ' }}{% endcapture %}

{% capture myFirstWord %}{{ allparts | truncatewords: 1 | remove: '...' }}{% endcapture %}
{% capture minusFirst %}{{ allparts | replace_first: myFirstWord, '' }}{% endcapture %}

{% capture mySecondWord %}{{ minusFirst | truncatewords: 1 | remove: '...' }}{% endcapture %}
{% capture minusSecond %}{{ minusFirst | replace_first: mySecondWord, '' }}{% endcapture %}

{% capture myThirdWord %}{{ minusSecond | truncatewords: 1 | remove: '...' }}{% endcapture %}
{% capture minusThird %}{{ minusSecond | replace_first: myThirdWord, '' }}{% endcapture %}

{% capture myFourthWord %}{{ minusThird | truncatewords: 1 | remove: '...' }}{% endcapture %}
{% capture minusFourth %}{{ minusThird | replace_first: myFourthWord, '' }}{% endcapture %}

{% capture myFifthWord %}{{ minusFourth | truncatewords: 1 | remove: '...' }}{% endcapture %}

{% if myFirstWord contains '.html' %}
<li><a href="/">home</a> &nbsp; </li>
{% elsif mySecondWord contains '.html' %}
<li><a href="/">home</a> &#187; </li>
{% unless mySecondWord == 'index.html' %}
<li><a href="/{{myFirstWord}}">{{myFirstWord}}</a> &#187; </li>
{% endunless %}
{% elsif myThirdWord contains '.html' %}
<li><a href="/">home</a> &#187; </li>
<li><a href="/{{myFirstWord}}">{{myFirstWord}}</a> &#187; </li>
{% unless myThirdWord == 'index.html' %}
<li><a href="/{{myFirstWord}}/{{mySecondWord}}">{{mySecondWord}}</a> &#187; </li>
{% endunless %}
{% elsif myFourthWord contains '.html' %}
<li><a href="/">home</a> &#187; </li>
<li><a href="/{{myFirstWord}}">{{myFirstWord}}</a> &#187; </li>
<li><a href="/{{myFirstWord}}/{{mySecondWord}}">{{mySecondWord}}</a> &#187; </li>
{% unless myFourthWord == 'index.html' %}
<li><a href="/{{myFirstWord}}/{{mySecondWord}}/{{myThirdWord}}">{{myThirdWord}}</a> &#187; </li>
{% endunless %}
{% elsif myFifthWord contains '.html' %}
<li><a href="/">home</a> &#187; </li>
<li><a href="/{{myFirstWord}}">{{myFirstWord}}</a> &#187; </li>
<li><a href="/{{myFirstWord}}/{{mySecondWord}}">{{mySecondWord}}</a> &#187; </li>
<li><a href="/{{myFirstWord}}/{{mySecondWord}}/{{myThirdWord}}">{{myThirdWord}}</a> &#187; </li>
{% unless myFourthWord == 'index.html' %}
<li><a href="/{{myFirstWord}}/{{mySecondWord}}/{{myThirdWord}}/{{myFourthWord}}">{{myFourthWord}}</a> &#187; </li>
{% endunless %}
{% else %}
<li><a href="/">home</a> &#187; </li>
<li><a href="/{{myFirstWord}}">{{myFirstWord}}</a> &#187; </li>
<li><a href="/{{myFirstWord}}/{{mySecondWord}}">{{mySecondWord}}</a> &#187; </li>
<li><a href="/{{myFirstWord}}/{{mySecondWord}}/{{myThirdWord}}">{{myThirdWord}}</a> &#187; </li>
{% endif %}

{% include breadcrumbs-end.html %}
1 change: 1 addition & 0 deletions _layouts/default.html
Expand Up @@ -8,6 +8,7 @@
<link rel="stylesheet" href="/master.css" type="text/css">
</head>
<body>
{% include breadcrumbs.html %}
<h1>{{ page.title }}</h1>
{{ content }}
</body>
Expand Down
3 changes: 3 additions & 0 deletions _layouts/post.html
Expand Up @@ -8,6 +8,9 @@
<link rel="stylesheet" href="/master.css" type="text/css">
</head>
<body>
{% include breadcrumbs-begin.html %}
<li><a href="/">home</a> &#187; </li>
{% include breadcrumbs-end.html %}
<h1>{{ page.title }}</h1>
<font size=-1>{{ page.date | date:"%Y-%m-%d" }} by <a href="/members/{{page.author}}">{{ site.authors[page.author]display_name }}</a></font>
{{ content }}
Expand Down
36 changes: 30 additions & 6 deletions master.css
@@ -1,18 +1,42 @@
body {
/*
background-color:silver;
*/
background-color:white;
background-color: white;
}

pre {
white-space: pre-wrap; /* http://www.w3.org/TR/CSS2/text.html */
border: 1px solid #DEDEDE;
}

code {
background-color: #F8F8F8;
border: 1px solid #DEDEDE;
}

pre code {
border: none;
}

h1 {
font-size: 140%
font-size: 140%;
margin-top: 4px;
margin-bottom: 4px;
}

h2 {
font-size: 100%
font-size: 100%;
}

#bread {
/* border: 1px solid #DEDEDE; */
}

#bread ul {
padding-left: 0;
margin-top: 2px;
margin-bottom: 2px;
}

#bread ul li {
display: inline;
font-size: 70%;
}

0 comments on commit e4d2615

Please sign in to comment.