Skip to content

Commit

Permalink
Add support keywords meta tag (#29)
Browse files Browse the repository at this point in the history
* Add support 'keywords' meta tag

* update

* update
  • Loading branch information
datlechin authored Apr 24, 2023
1 parent 3a17c8e commit 567a7b0
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/Commands/GenerateFaviconsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ public function handle(): int
if (! is_string($path)) {
$this->error('The `from` argument must be a string.');

return Command::FAILURE;
return self::FAILURE;
}

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

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.
Expand All @@ -56,6 +56,6 @@ public function handle(): int

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

return Command::SUCCESS;
return self::SUCCESS;
}
}
3 changes: 2 additions & 1 deletion src/SEOManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
/**
* @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.
Expand Down
4 changes: 2 additions & 2 deletions src/SEOServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function register(): void

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

if ($this->app->runningInConsole()) {
$this->commands([
Expand All @@ -26,7 +26,7 @@ public function boot(): void
}

$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) {
Expand Down

0 comments on commit 567a7b0

Please sign in to comment.