Skip to content

Commit c155bb1

Browse files
committed
Refactor package name and file paths to follow naming conventions and improve readability.
1 parent 00cc8e0 commit c155bb1

File tree

4 files changed

+69
-16
lines changed

4 files changed

+69
-16
lines changed

README.md

+55-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Fuelviews Laravel sitemap package
1+
# Fuelviews laravel sitemap package
22

33
[![Latest Version on Packagist](https://img.shields.io/packagist/v/fuelviews/laravel-sitemap.svg?style=flat-square)](https://packagist.org/packages/fuelviews/laravel-sitemap)
44
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/fuelviews/laravel-sitemap/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/fuelviews/laravel-sitemap/actions?query=workflow%3Arun-tests+branch%3Amain)
@@ -17,43 +17,83 @@ We highly appreciate you sending us a postcard from your hometown, mentioning wh
1717

1818
## Installation
1919

20-
You can install the package via composer:
20+
You can require the package and it's dependencies via composer:
2121

2222
```bash
2323
composer require fuelviews/laravel-sitemap
2424
```
2525

26-
You can publish and run the migrations with:
26+
You can install the package with:
2727

2828
```bash
29-
php artisan vendor:publish --tag="laravel-sitemap-migrations"
30-
php artisan migrate
29+
php artisan sitemap:install
3130
```
3231

33-
You can publish the config file with:
32+
You can manually publish the config file with:
3433

3534
```bash
36-
php artisan vendor:publish --tag="laravel-sitemap-config"
35+
php artisan vendor:publish --provider="Fuelviews\Sitemap\SitemapServiceProvider" --tag="laravel-sitemap-config"
3736
```
3837

3938
This is the contents of the published config file:
4039

4140
```php
4241
return [
42+
/**
43+
* Specifies the default filesystem disk that should be used.
44+
* The 'public_path' disk is typically used for files that need to be publicly accessible to users.
45+
* This setting can influence where files, such as generated sitemaps, are stored by default.
46+
*/
47+
'disk' => 'public',
48+
49+
/**
50+
* Determines whether the index page should be excluded from the sitemap.
51+
* Setting this to `true` will exclude the index page, `false` will include it.
52+
*/
53+
'exclude_index' => true,
54+
55+
/**
56+
* Controls whether redirect URLs should be excluded from the sitemap.
57+
* When set to `true`, all redirects are excluded to ensure the sitemap only contains direct links.
58+
*/
59+
'exclude_redirects' => true,
60+
61+
/**
62+
* An array of route names to be excluded from the sitemap.
63+
* Useful for excluding specific pages that should not be discoverable via search engines.
64+
*/
65+
'exclude_route_names' => [
66+
],
67+
68+
/**
69+
* Specifies paths that should be excluded from the sitemap.
70+
* Any routes starting with these paths will not be included in the sitemap, enhancing control over the sitemap contents.
71+
*/
72+
'exclude_paths' => [
73+
],
74+
75+
/**
76+
* An array of full URLs to be excluded from the sitemap.
77+
* This allows for fine-grained exclusion of specific pages, such as sitemap files or any other URLs not suitable for search engine indexing.
78+
*/
79+
'exclude_urls' => [
80+
'/sitemap.xml',
81+
'/pages_sitemap.xml',
82+
'/posts_sitemap.xml',
83+
],
4384
];
4485
```
4586

46-
Optionally, you can publish the views using
87+
You can generate the sitemap with:
4788

4889
```bash
49-
php artisan vendor:publish --tag="laravel-sitemap-views"
90+
php artisan sitemap:generate
5091
```
5192

5293
## Usage
5394

54-
```php
55-
$sitemap = new Fuelviews\Sitemap();
56-
echo $sitemap->echoPhrase('Hello, Fuelviews!');
95+
```
96+
To access the sitemap, navigate to your application's URL and append /sitemap.xml to it.For example, if your application is hosted at http://www.example.com, the sitemap can be found at http://www.example.com/sitemap.xml.
5797
```
5898

5999
## Testing
@@ -76,7 +116,9 @@ Please review [our security policy](../../security/policy) on how to report secu
76116

77117
## Credits
78118

79-
- [thejmitchener](https://github.com/thejmitchener)
119+
- [Thejmitchener](https://github.com/thejmitchener)
120+
- [Fuelviews](https://github.com/fuelviews)
121+
- [Spatie](https://github.com/spatie)
80122
- [All Contributors](../../contributors)
81123

82124
## License

composer.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"name": "fuelviews/laravel-sitemap",
3-
"description": "Fuelviews Laravel sitemap package",
3+
"description": "Fuelviews laravel sitemap package",
44
"keywords": [
55
"Fuelviews",
66
"laravel",
7-
"laravel-sitemap"
7+
"laravel-sitemap",
8+
"'"sitemap"
89
],
910
"homepage": "https://github.com/fuelviews/laravel-sitemap",
1011
"license": "MIT",
File renamed without changes.

src/SitemapServiceProvider.php

+11-1
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,24 @@ public function configurePackage(Package $package): void
2323
*/
2424
$package
2525
->name('laravel-sitemap')
26-
->hasConfigFile('fv-sitemap')
26+
->hasConfigFile()
2727
->publishesServiceProvider('SitemapServiceProvider')
2828
->hasCommands([
2929
SitemapGenerateCommand::class,
3030
InstallCommand::class,
3131
]);
3232
}
3333

34+
/**
35+
* TODO
36+
*/
37+
public function boot()
38+
{
39+
$this->publishes([
40+
__DIR__.'/../config/sitemap.php' => config_path('fv-sitemap.php'),
41+
], 'laravel-sitemap-config');
42+
}
43+
3444
/**
3545
* TODO
3646
*/

0 commit comments

Comments
 (0)