Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
bangnokia committed Mar 23, 2024
1 parent d4ba463 commit 36c9416
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion skeleton/resources/views/home.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
@extends('app')

@php
$posts = collect(cf()->index('posts'))->sort(fn($a, $b) => $b->createdAt <=> $a->createdAt);
@endphp

@section('content')
<h1 class="text-center">{{ $data->title }}</h1>

Expand All @@ -9,7 +13,7 @@
<div>
<h2>Latest posts</h2>
<ul style="display: flex; flex-direction: column; gap: 1rem; list-style: none; padding: 0">
@foreach(collect(cf()->index('posts'))->reverse() as $post)
@foreach($posts as $post)
<li>
<x-date>{{ $post->createdAt }}</x-date>
<a href="{{ $post->url() }}" class="block" style="padding: 0.25rem 0;">{{ $post->title }} {{ $post->createdAt }}</a>
Expand Down

0 comments on commit 36c9416

Please sign in to comment.