mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 01:54:04 +00:00
Merge branch 'docs' of github.com:stancl/tenancy into docs
This commit is contained in:
commit
5f1dc0b84d
6 changed files with 29 additions and 30 deletions
|
|
@ -3,10 +3,10 @@
|
||||||
use App\Listeners\GenerateSitemap;
|
use App\Listeners\GenerateSitemap;
|
||||||
use TightenCo\Jigsaw\Jigsaw;
|
use TightenCo\Jigsaw\Jigsaw;
|
||||||
|
|
||||||
/** @var $container \Illuminate\Container\Container */
|
/* @var $container \Illuminate\Container\Container */
|
||||||
/** @var $events \TightenCo\Jigsaw\Events\EventBus */
|
/* @var $events \TightenCo\Jigsaw\Events\EventBus */
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* You can run custom code at different stages of the build process by
|
* You can run custom code at different stages of the build process by
|
||||||
* listening to the 'beforeBuild', 'afterCollections', and 'afterBuild' events.
|
* listening to the 'beforeBuild', 'afterCollections', and 'afterBuild' events.
|
||||||
*
|
*
|
||||||
|
|
@ -18,4 +18,3 @@ use TightenCo\Jigsaw\Jigsaw;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$events->afterBuild(GenerateSitemap::class);
|
$events->afterBuild(GenerateSitemap::class);
|
||||||
|
|
||||||
|
|
|
||||||
10
config.php
10
config.php
|
|
@ -1,13 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'baseUrl' => '',
|
'baseUrl' => '',
|
||||||
'production' => false,
|
'production' => false,
|
||||||
'siteName' => 'stancl/tenancy documentation',
|
'siteName' => 'stancl/tenancy documentation',
|
||||||
'siteDescription' => 'A Laravel multi-database tenanyc package that respects your code.',
|
'siteDescription' => 'A Laravel multi-database tenanyc package that respects your code.',
|
||||||
|
|
||||||
// Algolia DocSearch credentials
|
// Algolia DocSearch credentials
|
||||||
'docsearchApiKey' => '',
|
'docsearchApiKey' => '',
|
||||||
'docsearchIndexName' => '',
|
'docsearchIndexName' => '',
|
||||||
|
|
||||||
// navigation menu
|
// navigation menu
|
||||||
|
|
@ -25,6 +25,6 @@ return [
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'url' => function ($page, $path) {
|
'url' => function ($page, $path) {
|
||||||
return starts_with($path, 'http') ? $path : '/' . trimPath($path);
|
return starts_with($path, 'http') ? $path : '/'.trimPath($path);
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'baseUrl' => 'https://my-jigsaw-docs.com',
|
'baseUrl' => 'https://my-jigsaw-docs.com',
|
||||||
'production' => true,
|
'production' => true,
|
||||||
|
|
||||||
// DocSearch credentials
|
// DocSearch credentials
|
||||||
'docsearchApiKey' => '',
|
'docsearchApiKey' => '',
|
||||||
'docsearchIndexName' => '',
|
'docsearchIndexName' => '',
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'baseUrl' => 'http://jigsaw-docs-staging.tighten.co',
|
'baseUrl' => 'http://jigsaw-docs-staging.tighten.co',
|
||||||
'production' => false,
|
'production' => false,
|
||||||
|
|
||||||
// DocSearch credentials
|
// DocSearch credentials
|
||||||
'docsearchApiKey' => '',
|
'docsearchApiKey' => '',
|
||||||
'docsearchIndexName' => '',
|
'docsearchIndexName' => '',
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -10,27 +10,27 @@ class GenerateSitemap
|
||||||
protected $exclude = [
|
protected $exclude = [
|
||||||
'/assets/*',
|
'/assets/*',
|
||||||
'*/favicon.ico',
|
'*/favicon.ico',
|
||||||
'*/404'
|
'*/404',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function handle(Jigsaw $jigsaw)
|
public function handle(Jigsaw $jigsaw)
|
||||||
{
|
{
|
||||||
$baseUrl = $jigsaw->getConfig('baseUrl');
|
$baseUrl = $jigsaw->getConfig('baseUrl');
|
||||||
|
|
||||||
if (! $baseUrl) {
|
if (!$baseUrl) {
|
||||||
echo("\nTo generate a sitemap.xml file, please specify a 'baseUrl' in config.php.\n\n");
|
echo "\nTo generate a sitemap.xml file, please specify a 'baseUrl' in config.php.\n\n";
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sitemap = new Sitemap($jigsaw->getDestinationPath() . '/sitemap.xml');
|
$sitemap = new Sitemap($jigsaw->getDestinationPath().'/sitemap.xml');
|
||||||
|
|
||||||
collect($jigsaw->getOutputPaths())
|
collect($jigsaw->getOutputPaths())
|
||||||
->reject(function ($path) {
|
->reject(function ($path) {
|
||||||
return $this->isExcluded($path);
|
return $this->isExcluded($path);
|
||||||
})->each(function ($path) use ($baseUrl, $sitemap) {
|
})->each(function ($path) use ($baseUrl, $sitemap) {
|
||||||
$sitemap->addItem(rtrim($baseUrl, '/') . $path, time(), Sitemap::DAILY);
|
$sitemap->addItem(rtrim($baseUrl, '/').$path, time(), Sitemap::DAILY);
|
||||||
});
|
});
|
||||||
|
|
||||||
$sitemap->write();
|
$sitemap->write();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,30 +2,30 @@
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'Getting Started' => [
|
'Getting Started' => [
|
||||||
'url' => 'docs/getting-started',
|
'url' => 'docs/getting-started',
|
||||||
'children' => [
|
'children' => [
|
||||||
'Installation' => 'docs/installation',
|
'Installation' => 'docs/installation',
|
||||||
'Storage Drivers' => 'docs/storage-drivers',
|
'Storage Drivers' => 'docs/storage-drivers',
|
||||||
'Configuration' => 'docs/configuration',
|
'Configuration' => 'docs/configuration',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'Usage' => [
|
'Usage' => [
|
||||||
'url' => 'docs/usage',
|
'url' => 'docs/usage',
|
||||||
'children' => [
|
'children' => [
|
||||||
'Creating Tenants' => 'docs/creating-tenants',
|
'Creating Tenants' => 'docs/creating-tenants',
|
||||||
'Tenant Routes' => 'docs/tenant-routes',
|
'Tenant Routes' => 'docs/tenant-routes',
|
||||||
'Tenant Storage' => 'docs/tenant-storage',
|
'Tenant Storage' => 'docs/tenant-storage',
|
||||||
'Console Commands' => 'docs/console-commands',
|
'Console Commands' => 'docs/console-commands',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'Digging Deeper' => [
|
'Digging Deeper' => [
|
||||||
'url' => 'docs/digging-deeper',
|
'url' => 'docs/digging-deeper',
|
||||||
'children' => [
|
'children' => [
|
||||||
'Middleware Configuration' => 'docs/middleware-configuration',
|
'Middleware Configuration' => 'docs/middleware-configuration',
|
||||||
'Custom Database Names' => 'docs/custom-database-names',
|
'Custom Database Names' => 'docs/custom-database-names',
|
||||||
'Development' => 'docs/development',
|
'Development' => 'docs/development',
|
||||||
]
|
],
|
||||||
],
|
],
|
||||||
'Stay Updated' => 'docs/stay-updated',
|
'Stay Updated' => 'docs/stay-updated',
|
||||||
'GitHub' => 'https://github.com/stancl/tenancy',
|
'GitHub' => 'https://github.com/stancl/tenancy',
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue