pull/533/head
Alper Ebicoglu 7 years ago
parent a899914ab1
commit 838c8910f0

@ -6,6 +6,8 @@ namespace Volo.Docs
{
public static string LatestVersion = "latest";
public static string WebsiteLinkFirstSegment = "documents";
public static VersionInfo DefaultVersion = new VersionInfo(LatestVersion, LatestVersion);
}
}

@ -47,7 +47,7 @@
<nav class="navbar navbar-logo">
@if (!Model.ProjectName.IsNullOrWhiteSpace())
{
<a class="navbar-brand w-100" href="/">
<a class="navbar-brand w-100" href="@Model.CreateLink(Model.GetSpecificVersionOrLatest())">
@Model.ProjectName<br>
<strong class="display-block">
@L["Documents"]

@ -110,10 +110,21 @@ namespace Volo.Docs.Pages.Documents.Project
VersionSelectItems = Versions.Select(v => new SelectListItem
{
Text = v.DisplayText,
Value = "/documents/" + ProjectName + "/" + v.Version + "/" + DocumentName,
Value = CreateLink(v.Version, DocumentName),
Selected = v.IsSelected
}).ToList();
}
public string CreateLink(string version, string documentName = null)
{
var link = "/" + DocsAppConsts.WebsiteLinkFirstSegment + "/" + ProjectName + "/" + version;
if (documentName != null)
{
link += "/" + DocumentName;
}
return link;
}
private VersionInfo GetLatestVersion()
@ -126,7 +137,7 @@ namespace Volo.Docs.Pages.Documents.Project
return latestVersion;
}
private string GetSpecificVersionOrLatest()
public string GetSpecificVersionOrLatest()
{
return Document.Version == LatestVersionInfo.Version ?
DocsAppConsts.LatestVersion :

Loading…
Cancel
Save