Boilerplate to use a Directus Instance to Build a Custom Website, Content will be Manage by Directus
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.4 KiB

3 years ago
  1. @extends('layout')
  2. {{-- pretend duplicate content --}}
  3. @push('head')
  4. <meta name="robots" content="noindex,follow" />
  5. @endpush
  6. {{-- inject helper for content & repositories --}}
  7. @inject('markdownHelper', 'App\Helpers\MarkdownHelper')
  8. @inject('postRepository', 'App\Repositories\PostRepository')
  9. @php
  10. $posts = $postRepository->find();
  11. @endphp
  12. @section('content')
  13. <h1>
  14. {{ $page['data']['title'] }}
  15. </h1>
  16. <div class="content">
  17. {!! $markdownHelper->parse($page['data']['content']) !!}
  18. </div>
  19. @if (count($posts) > 0)
  20. @foreach($posts['data'] as $post)
  21. <a class="post" href="/blog/{{ $post['slug'] }}">
  22. <header class="post__header">
  23. <h2 class="post__title">
  24. {{ $post['title'] }}
  25. </h2>
  26. @include('partials.date', ['post' => $post])
  27. @include('partials.readtime', ['post' => $post])
  28. @if (isset($post['media_teaser']['id']))
  29. <div class="post__teaser">
  30. <img src="{{ assetsUrl($post['media_teaser']['id']) }}" alt="{{ $post['media_teaser']['description'] }}" />
  31. </div>
  32. @endif
  33. </header>
  34. <div class="content post__lead">
  35. {!! $markdownHelper->parse($post['lead']) !!}
  36. </div>
  37. </div>
  38. @endforeach
  39. @else
  40. <div class="post">
  41. <p>
  42. Nothing!
  43. </p>
  44. </div>
  45. @endif
  46. @endsection