Render articles using a template like notes
This commit is contained in:
parent
42a85845fe
commit
acbb958475
4 changed files with 16 additions and 37 deletions
|
@ -9,25 +9,7 @@
|
|||
@endif
|
||||
|
||||
@foreach ($articles as $article)
|
||||
@if ($article->url != '') <article class="link h-entry">@else <article class="h-entry">@endif
|
||||
<header>
|
||||
<h1 class="p-name">
|
||||
@if($article->url == '')
|
||||
<a href="{{ $article->link }}">{{ $article->title }}</a>
|
||||
@else
|
||||
<a href="{{ $article->url }}">{{ $article->title }}</a>
|
||||
@endif
|
||||
</h1>
|
||||
<span class="post-info">Posted <time class="dt-published" title="{{ $article->tooltip_time }}" datetime="{{ $article->w3c_time }}">{{ $article->human_time }}</time> - <a title="Permalink" href="{{ $article->link }}">⚓</a></span>
|
||||
</header>
|
||||
<div class="e-content">
|
||||
{!! $article->html !!}
|
||||
</div>
|
||||
</article>
|
||||
@include('templates.article', ['article' => $article])
|
||||
@endforeach
|
||||
{{ $articles->links() }}
|
||||
@stop
|
||||
|
||||
@section('scripts')
|
||||
<link rel="stylesheet" href="/assets/highlight/zenburn.css">
|
||||
@stop
|
||||
|
|
|
@ -3,19 +3,5 @@
|
|||
@section('title'){{ strip_tags($article->title) }} « @stop
|
||||
|
||||
@section('content')
|
||||
@if($article->url != '') <article class="link h-entry">@else <article class="h-entry">@endif
|
||||
<header>
|
||||
<h1 class="p-name">
|
||||
<a href="@if($article->url == ''){{ $article->link }}@else{{ $article->url }}@endif">{{ $article->title }}</a>
|
||||
</h1>
|
||||
<span class="post-info">Posted <time class="dt-published" title="{{ $article->tooltip_time }}" datetime="{{ $article->w3c_time }}">{{ $article->human_time }}</time> - <a title="Permalink" href="{{ $article->link }}">⚓</a></span>
|
||||
</header>
|
||||
<div class="e-content">
|
||||
{!! $article->html !!}
|
||||
</div>
|
||||
</article>
|
||||
@stop
|
||||
|
||||
@section('scripts')
|
||||
<link rel="stylesheet" href="/assets/highlight/zenburn.css">
|
||||
@include('templates.article', ['article' => $article])
|
||||
@stop
|
||||
|
|
|
@ -11,10 +11,10 @@
|
|||
@foreach ($items as $item)
|
||||
@switch($item)
|
||||
@case($item instanceof \App\Models\Note)
|
||||
<p>This is a note</p>
|
||||
@include('templates.note', ['note' => $item])
|
||||
@break
|
||||
@case($item instanceof \App\Models\Article)
|
||||
<p>This is an article</p>
|
||||
@include('templates.article', ['article' => $item])
|
||||
@break
|
||||
@case($item instanceof \App\Models\Like)
|
||||
<p>This is a like</p>
|
||||
|
|
11
resources/views/templates/article.blade.php
Normal file
11
resources/views/templates/article.blade.php
Normal file
|
@ -0,0 +1,11 @@
|
|||
<article class="h-entry @if ($article->url != '') link @endif">
|
||||
<header>
|
||||
<h1 class="p-name">
|
||||
<a href="{{ $article->url ?? $article->link }}">{{ $article->title }}</a>
|
||||
</h1>
|
||||
<span class="post-info">Posted <time class="dt-published" title="{{ $article->tooltip_time }}" datetime="{{ $article->w3c_time }}">{{ $article->human_time }}</time> - <a title="Permalink" href="{{ $article->link }}">⚓</a></span>
|
||||
</header>
|
||||
<div class="e-content">
|
||||
{!! $article->html !!}
|
||||
</div>
|
||||
</article>
|
Loading…
Add table
Add a link
Reference in a new issue