Skip to content

Commit

Permalink
Added canonical on docs pages
Browse files Browse the repository at this point in the history
  • Loading branch information
tabuna committed Apr 23, 2024
1 parent 2b90e62 commit c5c95cc
Show file tree
Hide file tree
Showing 9 changed files with 300 additions and 113 deletions.
12 changes: 9 additions & 3 deletions app/Docs.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,21 @@ class Docs
*/
protected $model;

/**
* @var string The link name.
*/
public string $name;

/**
* Create a new Docs instance.
*
* @param string $version The version of the Laravel documentation.
* @param string $file The file name.
* @param string $name The link name.
*/
public function __construct(string $version, string $file)
public function __construct(string $version, string $name)
{
$this->file = $file.'.md';
$this->name = $name;
$this->file = $name.'.md';
$this->version = $version;
$this->path = "/$version/$this->file";
}
Expand Down
367 changes: 271 additions & 96 deletions composer.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions public/vendor/orchid/css/orchid.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions public/vendor/orchid/css/orchid.rtl.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions public/vendor/orchid/js/orchid.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/vendor/orchid/js/vendor.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions public/vendor/orchid/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"/js/orchid.js": "/js/orchid.js?id=ee3d8c7aaf28b1a1adccedaca1a406ce",
"/js/orchid.js": "/js/orchid.js?id=fcc80c086da592e07bb85d99fce6231d",
"/js/manifest.js": "/js/manifest.js?id=7cd3c79a9035e07fa5a4ca7bb5e26c4c",
"/css/orchid.rtl.css": "/css/orchid.rtl.css?id=c7551d146eefa2c6d9f64a52d98fa8d9",
"/css/orchid.css": "/css/orchid.css?id=7ffb291297ceb2c5ce88e064dc7257d2",
"/js/vendor.js": "/js/vendor.js?id=d133c98a2841ed3caa93c898600b68ee"
"/css/orchid.rtl.css": "/css/orchid.rtl.css?id=5a3f98402853c91cc1085d03656269bc",
"/css/orchid.css": "/css/orchid.css?id=0919a4a0f4c66dd7af4d138068239cad",
"/js/vendor.js": "/js/vendor.js?id=7a588c8be764e7bfb6dff3b52a9f4b66"
}
4 changes: 4 additions & 0 deletions resources/views/docs/docs.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
@section('title', $docs->title(). " Laravel ". $docs->version)
@section('description', $docs->description())

@push('head')
<link rel="canonical" href="{{ route('docs', ['version'=> \App\Docs::DEFAULT_VERSION, 'page'=> $docs->name]) }}">
@endpush

@section('content')

<div class="container container-docs my-4 my-xxl-5 mx-auto">
Expand Down
2 changes: 2 additions & 0 deletions resources/views/html.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@

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

@stack('head')

<x-meta
title="{!! View::getSection('title') ? strip_tags(View::getSection('title')) . ' | '. config('site.name') : config('site.name') !!}"
description="{!! View::getSection('description', config('site.description')) !!}"
Expand Down

0 comments on commit c5c95cc

Please sign in to comment.