Skip to content

Commit abfae9e

Browse files
committed
Tidy up
1 parent 522384b commit abfae9e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

app/Http/Controllers/DocsController.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ public function show($version, $page = null)
4848
define('CURRENT_VERSION', $version);
4949
}
5050

51-
$content = $this->docs->get($version, $page ?: 'installation');
51+
$sectionPage = $page ?: 'installation';
52+
$content = $this->docs->get($version, $sectionPage);
5253

5354
if (is_null($content)) {
5455
abort(404);
@@ -65,8 +66,8 @@ public function show($version, $page = null)
6566
}
6667

6768
$canonical = null;
68-
if ($this->docs->sectionExists(DEFAULT_VERSION, $page ?: 'installation')) {
69-
$canonical = 'docs/'.DEFAULT_VERSION.'/'.($page ?: 'installation');
69+
if ($this->docs->sectionExists(DEFAULT_VERSION, $sectionPage)) {
70+
$canonical = 'docs/'.DEFAULT_VERSION.'/'.$sectionPage;
7071
}
7172

7273
return view('docs', [

resources/views/app.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<meta name="keywords" content="laravel, php, framework, web, artisans, taylor otwell">
1010
<meta name="viewport" content="width=device-width, initial-scale=1">
1111

12-
@if (isset($canonical) && $canonical)
12+
@if (isset($canonical))
1313
<link rel="canonical" href="{{ url($canonical) }}" />
1414
@elseif (defined('CURRENT_VERSION') && in_array(CURRENT_VERSION, ['master', '5.1', '5.0', '4.2']))
1515
<meta name="robots" content="noindex">

0 commit comments

Comments
 (0)