-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from alexjoffroy/feature/add-blade-directives
Add `@meta` and `@metas` directives
- Loading branch information
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -156,6 +156,42 @@ class HomeController extends Controller | |
</html> | ||
``` | ||
|
||
Or you can use Blade directives: | ||
|
||
```php | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | ||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<meta name="author" content="Lito - [email protected]" /> | ||
|
||
<title>{!! Meta::get('title') !!}</title> | ||
|
||
@meta('robots') | ||
|
||
@meta('site_name', 'My site') | ||
@meta('url', Request::url()) | ||
@meta('locale', 'en_EN') | ||
|
||
@meta('title') | ||
@meta('description') | ||
|
||
{{-- Print custom section images and a default image after that --}} | ||
@meta('image', asset('images/default-logo.png')) | ||
|
||
{{-- Or use @metas to get all tags at once --}} | ||
@metas | ||
|
||
</head> | ||
|
||
<body> | ||
... | ||
</body> | ||
</html> | ||
``` | ||
|
||
### Config | ||
|
||
```php | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters