generated from rapidez/package-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
58794ba
commit 2b10b36
Showing
20 changed files
with
337 additions
and
374 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: analyse | ||
|
||
on: ['push', 'pull_request'] | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [ubuntu-latest] | ||
php: [8.3] | ||
laravel: [11.*] | ||
stability: [prefer-stable] | ||
include: | ||
- laravel: 11.* | ||
testbench: 9.* | ||
|
||
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo | ||
coverage: none | ||
|
||
- name: Install dependencies | ||
run: | | ||
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update | ||
composer update --${{ matrix.stability }} --prefer-dist --no-interaction | ||
- name: Analyse | ||
run: composer analyse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: style | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
style: | ||
name: Style | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.3 | ||
extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo | ||
coverage: none | ||
|
||
- name: Install dependencies | ||
run: composer install | ||
|
||
- name: Style | ||
run: composer fix-style | ||
|
||
- name: Commit Changes | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: Fix styling changes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: tests | ||
|
||
on: [ 'push', 'pull_request' ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
php: [ 8.2, 8.3 ] | ||
laravel: [ 11.* ] | ||
stability: [ prefer-lowest, prefer-stable ] | ||
include: | ||
- laravel: 11.* | ||
testbench: 9.* | ||
exclude: | ||
- laravel: 11.* | ||
php: 8.1 | ||
|
||
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo | ||
coverage: none | ||
|
||
- name: Install dependencies | ||
run: | | ||
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update | ||
composer update --${{ matrix.stability }} --prefer-dist --no-interaction | ||
- name: Execute tests | ||
run: composer test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,42 @@ | ||
# Rapidez :package_name_without_prefix | ||
<!--delete--> | ||
This repository can be used as template for a new Rapidez package. | ||
# Rapidez sitemap | ||
|
||
- Click on "Use this template" on the top of this Github repo page | ||
- Run `php ./configure.php` | ||
|
||
Credits to [`spatie/package-skeleton-laravel`](https://github.com/spatie/package-skeleton-laravel) for the inpiration for this template. | ||
|
||
Keep in mind that if you contribute to this template; it should work for official and unofficial packages! | ||
- `rapidez/something` | ||
- `someone/rapidez-something` | ||
<!--/delete--> | ||
:package_description | ||
Rapidez sitemap index through Eventy filters | ||
|
||
## Installation | ||
|
||
``` | ||
composer require :vendor_slug/:package_slug | ||
composer require rapidez/sitemap | ||
``` | ||
|
||
## Configuration | ||
## Views | ||
|
||
You can publish the config with: | ||
You can publish the views with: | ||
``` | ||
php artisan vendor:publish --tag=rapidez-:package_slug_without_prefix-config | ||
php artisan vendor:publish --tag=rapidez-sitemap-views | ||
``` | ||
|
||
## Views | ||
## Adding Additional Sitemap Indexes with Eventy | ||
|
||
You can publish the views with: | ||
``` | ||
php artisan vendor:publish --tag=rapidez-:package_slug_without_prefix-views | ||
If you have additional indexes, such as CMS pages or other custom routes, you can dynamically add them to your sitemap index based on the Store ID using the `rapidez.site.{storeId}` filter provided by Eventy. | ||
|
||
To do this, simply add the following code to the appropriate place in your application (e.g., in a service provider or a dedicated sitemap configuration file): | ||
|
||
```php | ||
use TorMorten\Eventy\Facades\Eventy; | ||
|
||
Eventy::addFilter('rapidez.sitemap.{storeId}', function ($sitemaps) { | ||
// Add your custom sitemap URL here | ||
$sitemaps[] = [ | ||
'loc' => url('/some-dynamic-url.xml'), | ||
'lastmod' => now()->toDateTimeString(), | ||
]; | ||
|
||
return $sitemaps; | ||
}); | ||
``` | ||
|
||
With this filter in place, the URL `/some-dynamic-url.xml` will be added to your sitemap index, allowing you to dynamically include additional sections of your site, such as CMS-generated pages, product categories, or other custom data sources. | ||
|
||
## License | ||
|
||
GNU General Public License v3. Please see [License File](LICENSE) for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,60 @@ | ||
{ | ||
"name": ":vendor_slug/:package_slug", | ||
"description": ":package_description", | ||
"name": "rapidez/sitemap", | ||
"description": "Rapidez sitemap index through Eventy filters", | ||
"keywords": [ | ||
"rapidez", | ||
":package_slug" | ||
"sitemap" | ||
], | ||
"homepage": "https://github.com/:vendor_slug/:package_slug", | ||
"homepage": "https://github.com/rapidez/sitemap", | ||
"license": "GPL-3.0-or-later", | ||
"authors": [ | ||
{ | ||
"name": ":author_name", | ||
"email": "[email protected]", | ||
"name": "Kevin Meijer", | ||
"email": "[email protected]", | ||
"role": "Developer" | ||
} | ||
], | ||
"minimum-stability": "dev", | ||
"prefer-stable": true, | ||
"require": { | ||
"php": "^8.1|^8.2", | ||
"rapidez/core": "^1.0" | ||
"rapidez/core": "^2.0", | ||
"ext-simplexml": "*" | ||
}, | ||
"require-dev": { | ||
"laravel/pint": "^1.7", | ||
"larastan/larastan": "^2.5", | ||
"phpstan/phpstan-mockery": "^1.1", | ||
"phpunit/phpunit": "^10.1", | ||
"orchestra/testbench": "^8.0|^9.0", | ||
"pestphp/pest": "^2.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"VendorName\\Skeleton\\": "src" | ||
"Rapidez\\Sitemap\\": "src" | ||
} | ||
}, | ||
"scripts": { | ||
"test": "phpunit", | ||
"analyse": "phpstan", | ||
"style": "pint --test", | ||
"quality": [ | ||
"@test", | ||
"@analyse", | ||
"@style" | ||
], | ||
"fix-style": "pint" | ||
}, | ||
"config": { | ||
"sort-packages": true | ||
"sort-packages": true, | ||
"allow-plugins": { | ||
"pestphp/pest-plugin": true | ||
} | ||
}, | ||
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"VendorName\\Skeleton\\SkeletonServiceProvider" | ||
"Rapidez\\Sitemap\\SitemapServiceProvider" | ||
] | ||
} | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.