Skip to content

Commit

Permalink
add open graph seo tags
Browse files Browse the repository at this point in the history
  • Loading branch information
saleem-hadad committed Sep 17, 2018
1 parent 8b48a67 commit 8eb0551
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
15 changes: 11 additions & 4 deletions publishable/config/larecipe.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,16 @@
|
*/

'seo' => [
'author' => '',
'description' => '',
'keywords' => ''
'seo' => [
'author' => '',
'description' => '',
'keywords' => '',
'og' => [
'title' => '',
'type' => 'article',
'url' => '',
'image' => '',
'description' => '',
]
]
];
3 changes: 3 additions & 0 deletions resources/views/default.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
@if (isset($canonical) && $canonical)
<link rel="canonical" href="{{ url($canonical) }}" />
@endif
@foreach (config('larecipe.seo.og') as $openGraphKey => $openGraphValue)
<meta property="og:{{ $openGraphKey }}" content="{{ $openGraphValue }}" />
@endforeach

{{-- CSS --}}
<link rel="stylesheet" href="{{ larecipe_assets('css/app.css') }}">
Expand Down
12 changes: 11 additions & 1 deletion tests/Feature/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,21 @@ public function seo_support()
Config::set('larecipe.seo.author', 'Binary Torch Author');
Config::set('larecipe.seo.description', 'seo description is here');
Config::set('larecipe.seo.keywords', 'key1, key2, key3');
Config::set('larecipe.seo.og.title', 'open graph title');
Config::set('larecipe.seo.og.type', 'open graph type');
Config::set('larecipe.seo.og.url', 'open graph url');
Config::set('larecipe.seo.og.image', 'open graph image');
Config::set('larecipe.seo.og.description', 'open graph description');

$this->get('/docs/1.0')
->assertSee('Binary Torch Author')
->assertSee('seo description is here')
->assertSee('key1, key2, key3');
->assertSee('key1, key2, key3')
->assertSee('open graph title')
->assertSee('open graph type')
->assertSee('open graph url')
->assertSee('open graph image')
->assertSee('open graph description');
}

/** @test */
Expand Down

0 comments on commit 8eb0551

Please sign in to comment.