initial blog view
- added blog with all posts
This commit is contained in:
1 parent
41d8fc020f
commit
1b2ccde8d8
4 files changed
+73
-4
No files matched your search
@@ -0,0 +1,68 @@
|
||||
---
|
||||
layout: null
|
||||
title: Blog
|
||||
---
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ site.lang }}">
|
||||
|
||||
{% include head.html %}
|
||||
|
||||
<body data-spy="scroll" data-offset="20" data-target="#navbar">
|
||||
|
||||
{% include navigation.html %}
|
||||
|
||||
<section class="{{ page.section-type }}">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<!-- This loops through the paginated posts -->
|
||||
{% for post in paginator.posts %}
|
||||
<h1><a href="{{site.baseurl}}{{post.url}}">{{post.title}}</a></h1>
|
||||
<div class="post-info">
|
||||
<i class="fa fa-calendar" aria-hidden="true"></i> {{ post.date | date_to_long_string }}
|
||||
<a href="https://github.com/{{ post.author }}" class="author-link">
|
||||
<img class="avatar" src="https://github.com/{{ post.author }}.png?size=18" alt="{{ post.author }}">
|
||||
{{ post.author }}
|
||||
</a>
|
||||
{% for tag in post.tags %}
|
||||
<div class="chip blue-bg">
|
||||
{{ tag }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div>
|
||||
{{post.excerpt | markdownify }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<!-- Pagination links -->
|
||||
{% if paginator.total_pages > 1 %}
|
||||
<div class="pagination">
|
||||
{% if paginator.previous_page %}
|
||||
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">« Prev</a>
|
||||
{% else %}
|
||||
<span>« Prev</span>
|
||||
{% endif %}
|
||||
|
||||
{% for page in (1..paginator.total_pages) %}
|
||||
{% if page == paginator.page %}
|
||||
<em>{{ page }}</em>
|
||||
{% elsif page == 1 %}
|
||||
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">{{ page }}</a>
|
||||
{% else %}
|
||||
<a href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}">{{ page }}</a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if paginator.next_page %}
|
||||
<a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">Next »</a>
|
||||
{% else %}
|
||||
<span>Next »</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user