File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
src/Elastic.Markdown/Slices Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 11
11
<link rel =" stylesheet preload" as =" style" type =" text/css" href =" @Model.Static(" styles.css " )" crossorigin />
12
12
@if (Model .CanonicalBaseUrl is not null )
13
13
{
14
- <link rel =" canonical" href =" @(new Uri( Model.CanonicalBaseUrl, Model.CurrentDocument.Url).ToString()) " >
14
+ <link rel =" canonical" href =" @Model.CanonicalUrl " / >
15
15
}
16
16
<meta name =" viewport" content =" width=device-width, initial-scale=1.0" >
17
17
@await RenderPartialAsync(_Favicon.Create())
18
18
<meta name =" robots" content =" @(Model.AllowIndexing ? " index, follow " : " noindex, nofollow " )" >
19
19
<meta name =" htmx-config" content =' {"selfRequestsOnly": true}' >
20
20
<meta property =" og:type" content =" website" />
21
- <meta property =" og:title" content =" Elastic Docs v3" />
22
- <meta name =" twitter:card" content =" summary" />
21
+ <meta property =" og:title" content =" @Model.Title" />
22
+ <meta property =" og:description" content =" @Model.Description" />
23
+ <meta property =" og:image" content =" https://www.elastic.co/static-res/images/social_media_default.png" />
24
+ <meta property =" og:image:alt" content =" Elastic | The Search AI Company" />
25
+ @if (! string .IsNullOrEmpty (Model .CanonicalUrl ))
26
+ {
27
+ <meta property =" og:url" content =" @Model.CanonicalUrl" />
28
+ }
23
29
</head >
Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ public class LayoutViewModel
47
47
public required string ? GithubEditUrl { get ; init ; }
48
48
public required bool AllowIndexing { get ; init ; }
49
49
public required Uri ? CanonicalBaseUrl { get ; init ; }
50
+
51
+ public string ? CanonicalUrl => CanonicalBaseUrl is not null ? new Uri ( CanonicalBaseUrl , CurrentDocument . Url ) . ToString ( ) : null ;
50
52
public required FeatureFlags Features { get ; init ; }
51
53
52
54
private MarkdownFile [ ] ? _parents ;
You can’t perform that action at this time.
0 commit comments