forked from OrchardCMS/OrchardDoc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_PageStart.cshtml
18 lines (18 loc) · 1 KB
/
_PageStart.cshtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
@{
var path = Request.PhysicalPath.Trim('\\');
if (path == Request.PhysicalApplicationPath.Trim('\\')) {
Page.DocumentTitle = "Orchard Documentation";
Page.Title = Page.DocumentTitle;
Page.EditUrl = "https://github.com/OrchardCMS/OrchardDoc/blob/master/Index.markdown";
}
else {
// https://github.com/NuGet/NuGetDocs/blob/master/Docs.Core/MarkdownEngine/MarkdownWebPage.cs
var caseSensitiveDocName = System.Web.Hosting.HostingEnvironment.VirtualPathProvider.GetFile(Request.Path + ".markdown").Name;
var docNameWithoutExtension = Path.GetFileNameWithoutExtension(caseSensitiveDocName);
Page.DocumentTitle = docNameWithoutExtension.Replace('-', ' ');
Page.Title = Page.DocumentTitle + " - Orchard Documentation";
Page.EditUrl = "https://github.com/OrchardCMS/OrchardDoc/blob/master/Documentation/" + caseSensitiveDocName;
}
Page.IssuesUrl = "https://github.com/OrchardCMS/OrchardDoc/issues";
Layout = "_SiteLayout.cshtml";
}