Skip to content

Commit c5c95cc

Browse files
committed
Added canonical on docs pages
1 parent 2b90e62 commit c5c95cc

File tree

9 files changed

+300
-113
lines changed

9 files changed

+300
-113
lines changed

app/Docs.php

+9-3
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,21 @@ class Docs
5858
*/
5959
protected $model;
6060

61+
/**
62+
* @var string The link name.
63+
*/
64+
public string $name;
65+
6166
/**
6267
* Create a new Docs instance.
6368
*
6469
* @param string $version The version of the Laravel documentation.
65-
* @param string $file The file name.
70+
* @param string $name The link name.
6671
*/
67-
public function __construct(string $version, string $file)
72+
public function __construct(string $version, string $name)
6873
{
69-
$this->file = $file.'.md';
74+
$this->name = $name;
75+
$this->file = $name.'.md';
7076
$this->version = $version;
7177
$this->path = "/$version/$this->file";
7278
}

composer.lock

+271-96
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/vendor/orchid/css/orchid.css

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/vendor/orchid/css/orchid.rtl.css

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/vendor/orchid/js/orchid.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/vendor/orchid/js/vendor.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"/js/orchid.js": "/js/orchid.js?id=ee3d8c7aaf28b1a1adccedaca1a406ce",
2+
"/js/orchid.js": "/js/orchid.js?id=fcc80c086da592e07bb85d99fce6231d",
33
"/js/manifest.js": "/js/manifest.js?id=7cd3c79a9035e07fa5a4ca7bb5e26c4c",
4-
"/css/orchid.rtl.css": "/css/orchid.rtl.css?id=c7551d146eefa2c6d9f64a52d98fa8d9",
5-
"/css/orchid.css": "/css/orchid.css?id=7ffb291297ceb2c5ce88e064dc7257d2",
6-
"/js/vendor.js": "/js/vendor.js?id=d133c98a2841ed3caa93c898600b68ee"
4+
"/css/orchid.rtl.css": "/css/orchid.rtl.css?id=5a3f98402853c91cc1085d03656269bc",
5+
"/css/orchid.css": "/css/orchid.css?id=0919a4a0f4c66dd7af4d138068239cad",
6+
"/js/vendor.js": "/js/vendor.js?id=7a588c8be764e7bfb6dff3b52a9f4b66"
77
}

resources/views/docs/docs.blade.php

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
@section('title', $docs->title(). " Laravel ". $docs->version)
33
@section('description', $docs->description())
44

5+
@push('head')
6+
<link rel="canonical" href="{{ route('docs', ['version'=> \App\Docs::DEFAULT_VERSION, 'page'=> $docs->name]) }}">
7+
@endpush
8+
59
@section('content')
610

711
<div class="container container-docs my-4 my-xxl-5 mx-auto">

resources/views/html.blade.php

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131

3232
<link rel="alternate" type="application/atom+xml" title="Новости" href="/rss/feed">
3333

34+
@stack('head')
35+
3436
<x-meta
3537
title="{!! View::getSection('title') ? strip_tags(View::getSection('title')) . ' | '. config('site.name') : config('site.name') !!}"
3638
description="{!! View::getSection('description', config('site.description')) !!}"

0 commit comments

Comments
 (0)