From dec7856c64fc28e3ab26cdb9d4a033d879627ff5 Mon Sep 17 00:00:00 2001 From: Michel Moraes Date: Mon, 24 Sep 2018 00:13:34 +0200 Subject: [PATCH] Fixing Header title and adding latest articles widget links --- index.php | 9 +++++---- resources/views/front-page.twig | 10 +++++++--- resources/views/header/index.twig | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/index.php b/index.php index 2844007..f3fdbc1 100644 --- a/index.php +++ b/index.php @@ -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); diff --git a/resources/views/front-page.twig b/resources/views/front-page.twig index d5b2467..2f7f100 100644 --- a/resources/views/front-page.twig +++ b/resources/views/front-page.twig @@ -77,14 +77,18 @@ {% set post_thumb = TimberImage(post.thumbnail) %}
-
+ +
+
-
{{ post.title }}
+
{{ post.preview.length(25).force }}
- +
{% endfor %} diff --git a/resources/views/header/index.twig b/resources/views/header/index.twig index 8649f81..9881a26 100644 --- a/resources/views/header/index.twig +++ b/resources/views/header/index.twig @@ -23,7 +23,7 @@
- {% if function('is_single') %} + {% if function('is_singular', 'post') %}

Blog

{% else %}

{{ post.title }}