Skip to content

Commit

Permalink
Fixing Header title and adding latest articles widget links
Browse files Browse the repository at this point in the history
  • Loading branch information
Michel Moraes committed Sep 23, 2018
1 parent d482761 commit dec7856
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
9 changes: 5 additions & 4 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

use Basecamp\Models\Post;

$context = Timber::get_context();
$context['post'] = new TimberPost();
$context['posts'] = new Timber\PostQuery();
$context['pagination'] = Timber::get_pagination($pagination_mid_size);
$context = Timber::get_context();
$post = new TimberPost();
$context['post'] = $post;
$context['posts'] = new Timber\PostQuery();
$context['pagination'] = Timber::get_pagination($pagination_mid_size);

Timber::render('index.twig', $context);
10 changes: 7 additions & 3 deletions resources/views/front-page.twig
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,18 @@
{% set post_thumb = TimberImage(post.thumbnail) %}

<div class="latest-articles__item">
<div class="latest-articles__item-image" style="background-image: url('{{ post_thumb.src|resize(600)}}')"></div>
<a href="{{ post.link }}">
<div class="latest-articles__item-image" style="background-image: url('{{ post_thumb.src|resize(600)}}')"></div>
</a>
<div class="latest-articles__item-content">
<div class="latest-articles__item-title">{{ post.title }}</div>
<div class="latest-articles__item-title">
<a href="{{ post.link }}">
{{ post.title }}</a></div>

<div class="latest-articles__item-copy">
{{ post.preview.length(25).force }}
</div>

</div>
</div>
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/header/index.twig
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<section class="hero is-primary is-bold has-text-right">
<div class="hero__body">
<div class="container">
{% if function('is_single') %}
{% if function('is_singular', 'post') %}
<h1 class="hero__body-title">Blog</h1>
{% else %}
<h1 class="hero__body-title">{{ post.title }}</h1>
Expand Down

0 comments on commit dec7856

Please sign in to comment.