Skip to content

Commit

Permalink
Merge tag 'v1.2.1' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
jobara committed Nov 21, 2023
2 parents 935485d + 9ca621e commit 66e81e8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .kube/app/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,7 @@ flock -n -E 0 /opt/data -c "php artisan deploy:global" # run exclusively on a si
## fix permissions after syncing to existing storage and cache https://github.com/accessibility-exchange/platform/issues/1236
chown -R www-data:root /app/bootstrap/cache $FILES_PATH # $CACHE_PATH removed per and added path to cache in the pod https://github.com/accessibility-exchange/platform/issues/1596

# Generate the robots.txt and sitemap.xml files
php artisan seo:generate

/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
1 change: 0 additions & 1 deletion app/Console/Commands/DeployLocal.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,5 @@ public function handle()
$this->call('icons:cache');
$this->call('event:cache');
$this->call('optimize');
$this->call('seo:generate');
}
}
4 changes: 3 additions & 1 deletion app/Console/Commands/GenerateSitemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Carbon\Carbon;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\Storage;

class GenerateSitemap extends Command
Expand Down Expand Up @@ -34,6 +35,7 @@ public function handle()
$routes = ['/' => ['en' => 'en', 'asl' => 'asl', 'fr' => 'fr', 'lsq' => 'lsq']];
// once deployed to the server, files have the same modified date, use README as a default last modified date
$lastmod = ['default' => Carbon::createFromTimestamp(filemtime('./README.md'))->toISOString()];
$hasPages = Schema::hasTable('pages'); // Check if the Pages table exists.
foreach (Route::getRoutes()->get('GET') as $route) {
if ($route->named(config('seo.sitemap.patterns'))) {
$routeURI = $route->uri();
Expand All @@ -42,7 +44,7 @@ public function handle()
$routes[$url][$locale] = $routeURI;
} else {
$routes[$url] = [$locale => $routeURI];
if ($route->named(config('seo.sitemap.pages'))) {
if ($route->named(config('seo.sitemap.pages')) && $hasPages) {
$routeName = explode('.', $route->getName());
/*
* TODO: come up with better query for the page, as slug may not follow the pattern in route name
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"framework",
"laravel"
],
"version": "1.2.0",
"version": "1.2.1",
"license": "BSD-3-Clause",
"require": {
"php": "^8.1",
Expand Down

0 comments on commit 66e81e8

Please sign in to comment.