Mirror your GitHub wiki with ease.
This Laravel 5 packages allows you to easily mirror the documentation on your GitHub wiki. This package has a simple configuration file and one single customizable view to allow you to have full control over the presentation of your documentation.
- Add the package to your installation using composer
composer require ikkentim/wikiclone. - Add the service provider to your
config/app.php. Underprovidersadd:
Ikkentim\WikiClone\WikiCloneServiceProvider::class,- Add the following routes to your
app/Http/routes.phpfile (feel free to modify the URLs):
Route::post('/', '\Ikkentim\WikiClone\Http\Controllers\WebhookController@trigger');
Route::get('/{page?}', '\Ikkentim\WikiClone\Http\Controllers\DocumentationController@index')
->where('page', '(.*)');- Important! The webhook used to update the website when the GitHub wiki is updated can't function properly when you have enabled the
VerifyCsrfTokenmiddleware (which is enabled by default). You can disable it by editingapp/Http/Kernel.phpand removing\App\Http\Middleware\VerifyCsrfToken::class. If you're using this Laravel installation for other things besides WikiClone, be sure to re-enable theVerifyCsrfTokenmiddleware for routers other than the ones you added above to keep your website secure. - Publish the assets from this package using the
php artisan vendor:publishcommand. - Open the
config/wikiclone.phpconfiguration file and edit therepositoryvalue to the github repository you intend to mirror. - Configure a webhook on the GitHub repository you're mirroring.
- On the repository's page, click on
Settings>Webhooks & services>Add webhook - Under
Payload URLenter the URL to the route toWebhookController@triggeryou've added to your routes file a few steps back. - Under
Secretenter your webhook secret as configured in your wikiclone configuration file. By default this is set to yourAPP_KEYfrom your.envfile.
- On the repository's page, click on
- You can now edit the
resources/views/vendor/wikiclone/documentation.blade.phpview to your liking. - (optional) Run the command
php artisan wiki:updateto re-fetch the documentation from the GitHub wiki.