Skip to content

Commit ca56990

Browse files
committed
Improve post and page templates, fix About link, remove Forum link
1 parent 6d6b8a4 commit ca56990

File tree

5 files changed

+49
-24
lines changed

5 files changed

+49
-24
lines changed

assets/css/rascal.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ body {
1212
background-color: #f5f5f5;
1313
margin-top: 0px;
1414
padding-top: 60px;
15+
position: static;
16+
/* to prevent weird overlap on page.hbs */
1517
}
1618
ul.nav li {
1719
display: inline;

assets/css/rascal.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ body {
2626
background-color: @rascal-bright-white;
2727
margin-top: 0px;
2828
padding-top: 60px;
29+
position: static; /* to prevent weird overlap on page.hbs */
2930
}
3031

3132
ul.nav li {

index.hbs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010
<a class="brand" href="/"><img src="http://rascalmicro.com/img/rm-logo-words-only-light.png"></a>
1111
<ul class="nav">
1212
<li class="active"><a href="http://store.rascalmicro.com">Store</a></li>
13-
<li><a href="/about.htm">About</a></li>
13+
<li><a href="/about">About</a></li>
1414
<li><a href="/blog/">Blog</a></li>
15-
<li><a href="/forum/">Forum</a></li>
1615
<li><a href="/docs/">Docs</a></li>
1716
</ul>
1817
</div>

page.hbs

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,32 @@
33
{{! This is a page template. A page outputs content just like any other post, and has all the same
44
attributes by default, but you can also customise it to behave differently if you prefer. }}
55

6+
<div class="navbar-fill">
7+
<div class="container">
8+
<a class="brand" href="/"><img src="http://rascalmicro.com/img/rm-logo-words-only-light.png"></a>
9+
<ul class="nav">
10+
<li class="active"><a href="http://store.rascalmicro.com">Store</a></li>
11+
<li><a href="/about">About</a></li>
12+
<li><a href="/blog/">Blog</a></li>
13+
<li><a href="/docs/">Docs</a></li>
14+
</ul>
15+
</div>
16+
</div>
17+
<script type="text/javascript">
18+
function activateNavbar() { // From https://gist.github.com/1362111, but with the regex tweaked
19+
var path = location.pathname.replace (/^(\/.+?\/).+$/, '$1');
20+
$('ul.nav li').removeClass("active");
21+
$('ul.nav a[href="' + path + '"]').parent().addClass("active");
22+
}
23+
$(function(){
24+
activateNavbar();
25+
})
26+
</script>
27+
628
<main class="content" role="main">
729

830
<article class="{{post_class}}">
931

10-
<header class="post-header">
11-
<a class="blog-logo" href="{{@blog.url}}">
12-
{{#if @blog.logo}}
13-
<img src="{{@blog.logo}}" alt="Blog Logo" />
14-
{{else}}
15-
<span class="blog-title">{{@blog.title}}</span>
16-
{{/if}}
17-
</a>
18-
</header>
19-
2032
{{#post}}
2133

2234
<h1 class="post-title">{{{title}}}</h1>

post.hbs

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,32 @@
33
{{! The comment above "< default" means - insert everything in this file into
44
the {body} of the default.hbs template, which contains our header/footer. }}
55

6+
<div class="navbar-fill">
7+
<div class="container">
8+
<a class="brand" href="/"><img src="http://rascalmicro.com/img/rm-logo-words-only-light.png"></a>
9+
<ul class="nav">
10+
<li class="active"><a href="http://store.rascalmicro.com">Store</a></li>
11+
<li><a href="/about">About</a></li>
12+
<li><a href="/blog/">Blog</a></li>
13+
<li><a href="/docs/">Docs</a></li>
14+
</ul>
15+
</div>
16+
</div>
17+
<script type="text/javascript">
18+
function activateNavbar() { // From https://gist.github.com/1362111, but with the regex tweaked
19+
var path = location.pathname.replace (/^(\/.+?\/).+$/, '$1');
20+
$('ul.nav li').removeClass("active");
21+
$('ul.nav a[href="' + path + '"]').parent().addClass("active");
22+
}
23+
$(function(){
24+
activateNavbar();
25+
})
26+
</script>
27+
628
<main class="content" role="main">
729

830
<article class="{{post_class}}">
931

10-
{{! Each post has the blog logo at the top, with a link back to the home page }}
11-
<header class="post-header">
12-
<a class="blog-logo" href="{{@blog.url}}">
13-
{{#if @blog.logo}}
14-
<img src="{{@blog.logo}}" alt="Blog Logo" />
15-
{{else}}
16-
<span class="blog-title">{{@blog.title}}</span>
17-
{{/if}}
18-
</a>
19-
</header>
20-
2132
{{! Everything inside the #post tags pulls data from the post }}
2233
{{#post}}
2334

@@ -58,4 +69,4 @@
5869

5970
</article>
6071

61-
</main>
72+
</main>

0 commit comments

Comments
 (0)