1
- # Fuelviews Laravel sitemap package
1
+ # Fuelviews laravel sitemap package
2
2
3
3
[ ![ Latest Version on Packagist] ( https://img.shields.io/packagist/v/fuelviews/laravel-sitemap.svg?style=flat-square )] ( https://packagist.org/packages/fuelviews/laravel-sitemap )
4
4
[ ![ 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
17
17
18
18
## Installation
19
19
20
- You can install the package via composer:
20
+ You can require the package and it's dependencies via composer:
21
21
22
22
``` bash
23
23
composer require fuelviews/laravel-sitemap
24
24
```
25
25
26
- You can publish and run the migrations with:
26
+ You can install the package with:
27
27
28
28
``` bash
29
- php artisan vendor:publish --tag=" laravel-sitemap-migrations"
30
- php artisan migrate
29
+ php artisan sitemap:install
31
30
```
32
31
33
- You can publish the config file with:
32
+ You can manually publish the config file with:
34
33
35
34
``` bash
36
- php artisan vendor:publish --tag=" laravel-sitemap-config"
35
+ php artisan vendor:publish --provider= " Fuelviews\Sitemap\SitemapServiceProvider " -- tag=" laravel-sitemap-config"
37
36
```
38
37
39
38
This is the contents of the published config file:
40
39
41
40
``` php
42
41
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
+ ],
43
84
];
44
85
```
45
86
46
- Optionally, you can publish the views using
87
+ You can generate the sitemap with:
47
88
48
89
``` bash
49
- php artisan vendor:publish --tag= " laravel- sitemap-views "
90
+ php artisan sitemap:generate
50
91
```
51
92
52
93
## Usage
53
94
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.
57
97
```
58
98
59
99
## Testing
@@ -76,7 +116,9 @@ Please review [our security policy](../../security/policy) on how to report secu
76
116
77
117
## Credits
78
118
79
- - [ thejmitchener] ( https://github.com/thejmitchener )
119
+ - [ Thejmitchener] ( https://github.com/thejmitchener )
120
+ - [ Fuelviews] ( https://github.com/fuelviews )
121
+ - [ Spatie] ( https://github.com/spatie )
80
122
- [ All Contributors] ( ../../contributors )
81
123
82
124
## License
0 commit comments