Merge pull request #119 from phil-opp/introduction

Add an introduction to the front page
This commit is contained in:
Philipp Oppermann
2016-01-19 22:23:10 +01:00
2 changed files with 18 additions and 7 deletions

View File

@@ -5,7 +5,7 @@
.masthead { .masthead {
padding-top: 1rem; padding-top: 1rem;
padding-bottom: 1rem; padding-bottom: 1rem;
margin-bottom: 3rem; margin-bottom: 1rem;
} }
.masthead-title { .masthead-title {
@@ -37,3 +37,7 @@
.navigation small { .navigation small {
margin-left: 1.5rem; margin-left: 1.5rem;
} }
.front-page-introduction {
margin-bottom: 2rem;
}

View File

@@ -2,27 +2,34 @@
layout: default layout: default
title: Home title: Home
--- ---
<div class="newest-post">
<emph>Latest Post</emph>: {% for post in site.posts limit:1 %} <div class="front-page-introduction"><p>
This blog series creates a small operating system in the
<a href="https://www.rust-lang.org/">Rust programming language</a>. Each post
is a small tutorial and includes all needed code, so you can follow along if
you like. The source code is also available in the corresponding
<a href="https://github.com/phil-opp/blog_os">Github repository</a>.
</p>
<p>Latest post: {% for post in site.posts limit:1 %}
<strong><a href="#{{ post.id }}" onclick=" <strong><a href="#{{ post.id }}" onclick="
post = document.getElementById('{{ post.id }}'); post = document.getElementById('{{ post.id }}');
post.className = post.className.replace(/\b updated\b/, ''); post.className = post.className.replace(/\b updated\b/, '');
post.offsetWidth = post.offsetWidth; // trigger reflow -> works on 2nd click, too post.offsetWidth = post.offsetWidth; // trigger reflow -> works on 2nd click, too
post.className += ' updated'; post.className += ' updated';
">{{post.title}}</a></strong> ">{{post.title}}</a></strong>
{% endfor %} {% endfor %}
</div> </p></div>
{% assign posts = site.posts | reverse %} {% assign posts = site.posts | reverse %}
<div class="post-category bare-bones">Bare Bones</div> <div id="bare-bones" class="post-category bare-bones">Bare Bones</div>
<div class="posts bare-bones"> <div class="posts bare-bones">
{% for post in posts limit:4 %} {% for post in posts limit:4 %}
{% include post_teaser.html %} {% include post_teaser.html %}
{% endfor %} {% endfor %}
</div> </div>
<div class="post-category memory-management">Memory Management</div> <div id="memory-management" class="post-category memory-management">Memory Management</div>
<div class="posts memory-management"> <div class="posts memory-management">
{% for post in posts offset:4 limit:3 %} {% for post in posts offset:4 limit:3 %}
{% include post_teaser.html %} {% include post_teaser.html %}