-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathBlogMetaPartial.cshtml
More file actions
63 lines (58 loc) · 2.63 KB
/
BlogMetaPartial.cshtml
File metadata and controls
63 lines (58 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
@model cloudscribe.SimpleContent.Web.ViewModels.BlogViewModel
@using cloudscribe.Web.Common.Extensions
@inject ISiteContextResolver siteResolver
@{
var imageUrl = Model.ExtractFirstImageUrl(Model.CurrentPost, Url);
var Tenant = await siteResolver.ResolveSite(Context.Request.Host.Host, Context.Request.Path);
var folderSegment = "";
if(!string.IsNullOrWhiteSpace(Tenant.SiteFolderName))
{
folderSegment = Tenant.SiteFolderName + "/";
}
var rssUrl = string.Format("/{0}api/rss/", folderSegment);
}
@if (Model.CurrentPost != null && !string.IsNullOrEmpty(Model.CurrentPost.MetaDescription))
{
<meta name="description" content="@Model.CurrentPost.MetaDescription" />
<meta property="og:title" content="@Model.CurrentPost.Title" />
<meta property="og:type" content="article" />
<meta property="og:url" content="@ViewContext.HttpContext.Request.GetCurrentFullUrl()" />
@if (!string.IsNullOrEmpty(imageUrl))
{
<meta property="og:image" content="@imageUrl" />
}
<meta property="og:description" content="@Model.CurrentPost.MetaDescription" />
@if (!string.IsNullOrWhiteSpace(Model.ProjectSettings.SiteName))
{
<meta property="og:site_name" content="@Model.ProjectSettings.SiteName" />
}
@if (!string.IsNullOrWhiteSpace(Model.ProjectSettings.FacebookAppId))
{
<meta property="fb:app_id" content="@Model.ProjectSettings.FacebookAppId" />
}
<meta name="twitter:card" content="summary">
@if (!string.IsNullOrWhiteSpace(Model.ProjectSettings.TwitterPublisher))
{
<meta name="twitter:site" content="@Model.ProjectSettings.TwitterPublisher" />
}
<meta name="twitter:title" content="@Model.CurrentPost.Title">
<meta name="twitter:description" content="@Model.CurrentPost.MetaDescription">
@if (!string.IsNullOrWhiteSpace(Model.ProjectSettings.TwitterCreator))
{
<meta name="twitter:creator" content="@Model.ProjectSettings.TwitterCreator" />
}
@if (!string.IsNullOrEmpty(imageUrl))
{
<meta name="twitter:image" content="@imageUrl" />
}
}
@*
TODO: implement this stuff
RSD: Discoverability of Blog APIs
http://mashupguide.net/1.0/html/ch05s06.xhtml
http://en.wikipedia.org/wiki/Really_Simple_Discovery
<link type="application/rsd+xml" rel="edituri" title="RSD" href="~/views/robots/rsd" />
<link type="application/atom+xml" rel="alternate" title="@Model.BlogSettings.Title" href="~/feed/atom/" />
*@
<link type="application/rss+xml" rel="alternate" title="@Model.ProjectSettings.Title" href="@rssUrl" />
<link type="application/wlwmanifest+xml" rel="wlwmanifest" href="~/wlwmanifest.xml" />