Skip to content

Commit

Permalink
#113 Blog decoupled from home.html
Browse files Browse the repository at this point in the history
  • Loading branch information
sylhare committed Oct 23, 2018
1 parent b2a16c3 commit 5ac9fb1
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 49 deletions.
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ theme_settings:
# Header and footer text
header_text: > #two or three lines to describe your site
<p>Change header text in <code>_config.yml</code> <br> to update this feature.</p>
header_text_feature_image: assets/img/pexels/triangular.jpeg
header_feature_image: assets/img/pexels/triangular.jpeg
footer_text: >
Powered by <a href="https://jekyllrb.com/">Jekyll</a> with <a href="https://github.com/sylhare/Type-on-Strap">Type on Strap</a>
Expand Down
44 changes: 44 additions & 0 deletions _includes/blog.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<div class="posts">
{% for post in paginator.posts %}
<div class="post-teaser">
{% if post.thumbnail %}
<div class="post-img">
<img src="{{ site.baseurl }}/{{ post.thumbnail }}">
</div>
{% endif %}
<span>
<header>
<h1>
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">
{{ post.title }}
</a>
</h1>
<p class="meta">
{{ post.date | date: "%B %-d, %Y" }}
</p>
</header>
<div class="excerpt">
{{ post.excerpt | strip_html | escape }}
<!--{{ post.content | strip_html | truncate: "250" }}-->
<!--<a class="button" href="{{ post.url | prepend: site.baseurl }}">
{{ site.theme_settings.str_continue_reading }}
</a>-->
</div>
</span>
</div>
{% endfor %}
</div>

{% if paginator.total_pages > 1 %}
<div class="pagination">
{% if paginator.previous_page %}
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}" class="button">
<i class="fa fa-chevron-left"></i>
{{ site.theme_settings.str_previous_page }}
</a> {% endif %} {% if paginator.next_page %}
<a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}" class="button">
{{ site.theme_settings.str_next_page }}
<i class="fa fa-chevron-right"></i>
</a> {% endif %}
</div>
{% endif %}
51 changes: 3 additions & 48 deletions _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,11 @@
<div class="home">
{% if site.theme_settings.header_text %}
<div id="main" class="call-out"
style="background-image: url('{{ site.baseurl }}/{{ site.theme_settings.header_text_feature_image }}')">
style="background-image: url('{{ site.baseurl }}/{{ site.theme_settings.header_feature_image }}')">
{{ site.theme_settings.header_text }}
</div>
{% endif %}

<div class="posts">
{% for post in paginator.posts %}
<div class="post-teaser">
{% if post.thumbnail %}
<div class="post-img">
<img src="{{ site.baseurl }}/{{ post.thumbnail }}">
</div>
{% endif %}
<span>
<header>
<h1>
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">
{{ post.title }}
</a>
</h1>
<p class="meta">
{{ post.date | date: "%B %-d, %Y" }}
</p>
</header>
<div class="excerpt">
{{ post.excerpt | strip_html | escape }}
<!--{{ post.content | strip_html | truncate: "250" }}-->
<!--<a class="button" href="{{ post.url | prepend: site.baseurl }}">
{{ site.theme_settings.str_continue_reading }}
</a>-->
</div>
</span>
</div>
{% endfor %}
</div>

{% if paginator.total_pages > 1 %}
<div class="pagination">
{% if paginator.previous_page %}
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}" class="button" >
<i class="fa fa-chevron-left"></i>
{{ site.theme_settings.str_previous_page }}
</a>
{% endif %}
{% if paginator.next_page %}
<a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}" class="button" >
{{ site.theme_settings.str_next_page }}
<i class="fa fa-chevron-right"></i>
</a>
{% endif %}
</div>
{% endif %}
{% include blog.html %}

</div>

0 comments on commit 5ac9fb1

Please sign in to comment.