Skip to content

Commit 567a7b0

Browse files
authored
Add support keywords meta tag (#29)
* Add support 'keywords' meta tag * update * update
1 parent 3a17c8e commit 567a7b0

File tree

6 files changed

+12
-7
lines changed

6 files changed

+12
-7
lines changed

assets/views/components/meta.blade.php renamed to resources/views/components/meta.blade.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
<meta name="description" content="@seo('description')" />
1313
@endif
1414

15+
@if(seo('keywords'))
16+
<meta name="keywords" content="@seo('keywords')" />
17+
@endif
18+
1519
@if(seo('type'))
1620
<meta property="og:type" content="@seo('type')" />
1721
@else

src/Commands/GenerateFaviconsCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,21 @@ public function handle(): int
2020
if (! is_string($path)) {
2121
$this->error('The `from` argument must be a string.');
2222

23-
return Command::FAILURE;
23+
return self::FAILURE;
2424
}
2525

2626
$this->info('Generating favicons...');
2727

2828
if (! class_exists(ImageManager::class)) {
2929
$this->error('Intervention not available, please run `composer require intervention/image`');
3030

31-
return Command::FAILURE;
31+
return self::FAILURE;
3232
}
3333

3434
if (! file_exists($path)) {
3535
$this->error("Given icon path `{$path}` does not exist.");
3636

37-
return Command::FAILURE;
37+
return self::FAILURE;
3838
}
3939

4040
// GD driver doesn't support .ico, that's why we use ImageMagick.
@@ -56,6 +56,6 @@ public function handle(): int
5656

5757
$this->info('All favicons have been generated!');
5858

59-
return Command::SUCCESS;
59+
return self::SUCCESS;
6060
}
6161
}

src/SEOManager.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111
/**
1212
* @method $this title(string $title = null, ...$args) Set the title.
1313
* @method $this description(string $description = null, ...$args) Set the description.
14+
* @method $this keywords(string $keywords = null, ...$args) Set the keywords.
1415
* @method $this url(string $url = null, ...$args) Set the canonical URL.
1516
* @method $this site(string $site = null, ...$args) Set the site name.
1617
* @method $this image(string $url = null, ...$args) Set the cover image.
1718
* @method $this type(string $type = null, ...$args) Set the page type.
1819
* @method $this locale(string $locale = null, ...$args) Set the page locale.
19-
* @method $this twitter(enabled $bool = true, ...$args) Enable the Twitter extension.
20+
* @method $this twitter(bool $enabled = true, ...$args) Enable the Twitter extension.
2021
* @method $this twitterCreator(string $username = null, ...$args) Set the Twitter author.
2122
* @method $this twitterSite(string $username = null, ...$args) Set the Twitter author.
2223
* @method $this twitterTitle(string $title = null, ...$args) Set the Twitter title.

src/SEOServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function register(): void
1717

1818
public function boot(): void
1919
{
20-
$this->loadViewsFrom(__DIR__ . '/../assets/views', 'seo');
20+
$this->loadViewsFrom(__DIR__ . '/../resources/views', 'seo');
2121

2222
if ($this->app->runningInConsole()) {
2323
$this->commands([
@@ -26,7 +26,7 @@ public function boot(): void
2626
}
2727

2828
$this->publishes([
29-
__DIR__ . '/../assets/views' => resource_path('views/vendor/seo'),
29+
__DIR__ . '/../resources/views' => resource_path('views/vendor/seo'),
3030
], 'seo-views');
3131

3232
Blade::directive('seo', function ($expression) {

0 commit comments

Comments
 (0)