Skip to content

Commit

Permalink
🔍 Add SEO descriptions to the docs pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Log1x committed Jan 31, 2024
1 parent 3f59861 commit a1b9419
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 2 deletions.
6 changes: 5 additions & 1 deletion app/Livewire/Docs/Show.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ public function mount(string $page)
$this->page = Docs::findOrFail($page);

seo()
->title("{$this->page->title} | Laracord")
->title("{$this->page->title} Docs | Laracord")
->canonical(route('docs.show', $this->page->slug));

if ($this->page->description) {
seo()->description($this->page->description);
}
}

/**
Expand Down
1 change: 1 addition & 0 deletions app/Models/Docs.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public static function schema(Blueprint $table)
{
$table->string('slug');
$table->string('title');
$table->string('description')->nullable();
$table->string('group')->nullable();
$table->integer('priority')->default(1);
$table->longText('content');
Expand Down
3 changes: 2 additions & 1 deletion content/docs/chatgpt.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
---
slug: chatgpt
title: 'ChatGPT Example'
description: 'Easily create a Discord bot that interacts with ChatGPT using Laracord.'
priority: 1
group: Examples
---

Create a command to interact with OpenAI's API is quite easy thanks to the official [Laravel OpenAI package](https://github.com/openai-php/laravel).
Creating a Discord command to interact with OpenAI's API is quite easy thanks to the official [Laravel OpenAI package](https://github.com/openai-php/laravel).

In this example, we will create a simple `!chat` command to ask ChatGPT questions through the Discord bot.

Expand Down
1 change: 1 addition & 0 deletions content/docs/commands.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
slug: commands
title: 'Commands'
description: 'Learn how to create Discord bot commands with Laracord.'
priority: 1
group: Usage
---
Expand Down
1 change: 1 addition & 0 deletions content/docs/configuration.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
slug: configuration
title: 'Configuration'
description: 'Configuring Laracord to get a Discord bot up and running can be done in just a few minutes.'
priority: 2
group: 'Getting Started'
---
Expand Down
1 change: 1 addition & 0 deletions content/docs/deployment.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
slug: deployment
title: 'Deployment'
description: 'Bundle Laracord into a PHAR to run your Discord bot in production.'
priority: 4
group: 'Getting Started'
---
Expand Down
1 change: 1 addition & 0 deletions content/docs/events.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
slug: events
title: 'Events'
description: 'Quickly hook into Discord events with your Laracord bot.'
priority: 3
group: Usage
---
Expand Down
1 change: 1 addition & 0 deletions content/docs/hooks.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
slug: hooks
title: 'Hooks'
description: 'Laracord has support for 45+ Discord hooks out of the box.'
priority: 1
group: Advanced
---
Expand Down
1 change: 1 addition & 0 deletions content/docs/installation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
slug: installation
title: 'Installation'
description: 'Learn how to install Laracord and get a Discord bot up and running in just a few steps.'
priority: 1
group: 'Getting Started'
---
Expand Down
1 change: 1 addition & 0 deletions content/docs/services.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
slug: services
title: 'Services'
description: 'Create services alongside your Laracord Discord bot to run asynchronous tasks.'
priority: 4
group: Usage
---
Expand Down
1 change: 1 addition & 0 deletions content/docs/slash-commands.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
slug: slash-commands
title: 'Slash Commands'
description: 'Create powerful Discord slash commands and let Laracord handle the hard work for you.'
priority: 2
group: Usage
---
Expand Down
1 change: 1 addition & 0 deletions content/docs/state.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
slug: state
title: 'State'
description: 'Easily access the full state of your Laracord Discord bot in any class.'
priority: 5
group: Usage
---
Expand Down
1 change: 1 addition & 0 deletions content/docs/structure.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
slug: structure
title: 'Directory Structure'
description: 'If you are comfortable with Laravel, Laracord provides a very familiar starting point.'
priority: 3
group: 'Getting Started'
---
Expand Down

0 comments on commit a1b9419

Please sign in to comment.