@extends('theme::layout')

@section('content')
    <div class="panel">
        <h1 class="page-title">搜索</h1>
        <form class="stack" method="get" action="{{ url('/search.shtml') }}">
            <label>关键词</label>
            <input name="keywords" value="{{ $keywords }}" placeholder="标题或正文">
            <button type="submit">搜索</button>
        </form>
    </div>
    <div class="post-list">
        @foreach($articles as $article)
            <article class="post-item">
                <h2><a href="{{ url('/show-'.$article->id.'.shtml') }}">{{ $article->title }}</a></h2>
                <p class="meta">{{ optional($article->published_at)->format('Y-m-d') }}</p>
            </article>
        @endforeach
    </div>
    <div class="pagination">{{ $articles->links() }}</div>
@endsection
