mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Add bare bones and memory management categories
This commit is contained in:
23
_includes/post_teaser.html
Normal file
23
_includes/post_teaser.html
Normal file
@@ -0,0 +1,23 @@
|
||||
<article class="post" id="{{ post.id }}">
|
||||
<h1 class="post-title">
|
||||
<a href="{{ site.baseurl }}{{ post.url }}">
|
||||
{{ post.title }}
|
||||
</a>
|
||||
</h1>
|
||||
|
||||
<span class="post-date">
|
||||
<time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date_to_string }}</time>
|
||||
{% if post.updated %}
|
||||
(updated on {{ post.updated | date_to_string }})
|
||||
{% endif %}
|
||||
</span>
|
||||
|
||||
{% if post.content contains '<!--more-->' %}
|
||||
{{ post.content | split:'<!--more-->' | first }}
|
||||
{% else %}
|
||||
{{ post.excerpt }}
|
||||
{% endif %}
|
||||
</article>
|
||||
{% if forloop.last == false %}
|
||||
<hr>
|
||||
{% endif %}
|
||||
@@ -86,3 +86,33 @@
|
||||
margin-bottom: 2em;
|
||||
margin-top: -2em;
|
||||
}
|
||||
|
||||
@mixin category-posts($color) {
|
||||
border: 2px solid $color;
|
||||
border-radius: 5px;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
@mixin category-title($color) {
|
||||
color: $color;
|
||||
margin-right: 0.5rem;
|
||||
text-transform: uppercase;
|
||||
font-size: 0.8rem;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.posts.bare-bones {
|
||||
@include category-posts(#99f);
|
||||
}
|
||||
|
||||
.post-category.bare-bones {
|
||||
@include category-title(#66f);
|
||||
}
|
||||
|
||||
.posts.memory-management {
|
||||
@include category-posts(#cc0);
|
||||
}
|
||||
|
||||
.post-category.memory-management {
|
||||
@include category-title(#990);
|
||||
}
|
||||
|
||||
40
index.html
40
index.html
@@ -13,28 +13,24 @@ title: Home
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="posts">
|
||||
{% for post in site.posts reversed %}
|
||||
<article class="post" id="{{ post.id }}">
|
||||
<h1 class="post-title">
|
||||
<a href="{{ site.baseurl }}{{ post.url }}">
|
||||
{{ post.title }}
|
||||
</a>
|
||||
</h1>
|
||||
{% assign posts = site.posts | reverse %}
|
||||
|
||||
<span class="post-date">
|
||||
<time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date_to_string }}</time>
|
||||
{% if post.updated %}
|
||||
(updated on {{ post.updated | date_to_string }})
|
||||
{% endif %}
|
||||
</span>
|
||||
|
||||
{% if post.content contains '<!--more-->' %}
|
||||
{{ post.content | split:'<!--more-->' | first }}
|
||||
{% else %}
|
||||
{{ post.excerpt }}
|
||||
{% endif %}
|
||||
</article>
|
||||
<hr>
|
||||
<div class="post-category bare-bones">Bare Bones</div>
|
||||
<div class="posts bare-bones">
|
||||
{% for post in posts limit:4 %}
|
||||
{% include post_teaser.html %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="post-category memory-management">Memory Management</div>
|
||||
<div class="posts memory-management">
|
||||
{% for post in posts offset:4 limit:2 %}
|
||||
{% include post_teaser.html %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="posts">
|
||||
{% for post in posts offset:6 %}
|
||||
{% include post_teaser.html %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user