Skip to content

Commit

Permalink
json-ld
Browse files Browse the repository at this point in the history
  • Loading branch information
sdebacker committed Apr 6, 2019
1 parent 7afbe38 commit b237548
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/resources/views/public/_json-ld.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "NewsArticle",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "{{ url($model->uri()) }}"
},
"headline": "{{ $model->title }}",
"image": [
"{{ $model->present()->image() }}"
],
"datePublished": "{{ $model->date }}",
"dateModified": "{{ $model->updated_at }}",
"author": {
"@type": "Organization",
"name": "microStart"
},
"publisher": {
"@type": "Organization",
"name": "microStart",
"logo": {
"@type": "ImageObject",
"url": "{{ Storage::url('settings/' . config('typicms.image')) }}"
}
},
"description": "{{ preg_replace( "/\r|\n/", " ", $model->summary) }}"
}
</script>
1 change: 1 addition & 0 deletions src/resources/views/public/_list-item.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@include('news::public._json-ld', ['model' => $news])
<li class="news-list-item">
<a class="news-list-item-link" href="{{ $news->uri() }}">
<img class="news-list-item-image" src="{!! $news->present()->image(540, 400) !!}" alt="">
Expand Down
2 changes: 2 additions & 0 deletions src/resources/views/public/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

@include('core::public._btn-prev-next', ['module' => 'News', 'model' => $model])

@include('news::public._json-ld')

<article class="news">
<h1 class="news-title">{{ $model->title }}</h1>
<img class="news-image" src="{!! $model->present()->image(null, 200) !!}" alt="">
Expand Down

0 comments on commit b237548

Please sign in to comment.