Skip to content

Commit

Permalink
Init (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmeijer97 authored Nov 5, 2024
1 parent 58794ba commit 2b10b36
Show file tree
Hide file tree
Showing 20 changed files with 337 additions and 374 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/analyse.yml
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
32 changes: 32 additions & 0 deletions .github/workflows/style.yml
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
40 changes: 40 additions & 0 deletions .github/workflows/tests.yml
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
46 changes: 25 additions & 21 deletions README.md
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.
43 changes: 33 additions & 10 deletions composer.json
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"
]
}
}
Expand Down
4 changes: 0 additions & 4 deletions config/rapidez/skeleton.php

This file was deleted.

Loading

0 comments on commit 2b10b36

Please sign in to comment.