1
0
Fork 0
mirror of https://github.com/archtechx/laravel-seo.git synced 2025-12-12 01:44:03 +00:00

Add support keywords meta tag (#29)

* Add support 'keywords' meta tag

* update

* update
This commit is contained in:
Ngô Quốc Đạt 2023-04-24 10:18:46 +07:00 committed by GitHub
parent 3a17c8ee11
commit 567a7b09ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 7 deletions

View file

@ -12,6 +12,10 @@
<meta name="description" content="@seo('description')" />
@endif
@if(seo('keywords'))
<meta name="keywords" content="@seo('keywords')" />
@endif
@if(seo('type'))
<meta property="og:type" content="@seo('type')" />
@else

View file

@ -20,7 +20,7 @@ class GenerateFaviconsCommand extends Command
if (! is_string($path)) {
$this->error('The `from` argument must be a string.');
return Command::FAILURE;
return self::FAILURE;
}
$this->info('Generating favicons...');
@ -28,13 +28,13 @@ class GenerateFaviconsCommand extends Command
if (! class_exists(ImageManager::class)) {
$this->error('Intervention not available, please run `composer require intervention/image`');
return Command::FAILURE;
return self::FAILURE;
}
if (! file_exists($path)) {
$this->error("Given icon path `{$path}` does not exist.");
return Command::FAILURE;
return self::FAILURE;
}
// GD driver doesn't support .ico, that's why we use ImageMagick.
@ -56,6 +56,6 @@ class GenerateFaviconsCommand extends Command
$this->info('All favicons have been generated!');
return Command::SUCCESS;
return self::SUCCESS;
}
}

View file

@ -11,12 +11,13 @@ use Illuminate\Support\Str;
/**
* @method $this title(string $title = null, ...$args) Set the title.
* @method $this description(string $description = null, ...$args) Set the description.
* @method $this keywords(string $keywords = null, ...$args) Set the keywords.
* @method $this url(string $url = null, ...$args) Set the canonical URL.
* @method $this site(string $site = null, ...$args) Set the site name.
* @method $this image(string $url = null, ...$args) Set the cover image.
* @method $this type(string $type = null, ...$args) Set the page type.
* @method $this locale(string $locale = null, ...$args) Set the page locale.
* @method $this twitter(enabled $bool = true, ...$args) Enable the Twitter extension.
* @method $this twitter(bool $enabled = true, ...$args) Enable the Twitter extension.
* @method $this twitterCreator(string $username = null, ...$args) Set the Twitter author.
* @method $this twitterSite(string $username = null, ...$args) Set the Twitter author.
* @method $this twitterTitle(string $title = null, ...$args) Set the Twitter title.

View file

@ -17,7 +17,7 @@ class SEOServiceProvider extends ServiceProvider
public function boot(): void
{
$this->loadViewsFrom(__DIR__ . '/../assets/views', 'seo');
$this->loadViewsFrom(__DIR__ . '/../resources/views', 'seo');
if ($this->app->runningInConsole()) {
$this->commands([
@ -26,7 +26,7 @@ class SEOServiceProvider extends ServiceProvider
}
$this->publishes([
__DIR__ . '/../assets/views' => resource_path('views/vendor/seo'),
__DIR__ . '/../resources/views' => resource_path('views/vendor/seo'),
], 'seo-views');
Blade::directive('seo', function ($expression) {