Browse Source

Merge pull request #23037 from abpframework/issue-23012

fix: Navigation Bug
pull/23039/head
Enis Necipoglu 1 year ago
committed by GitHub
parent
commit
03801abee1
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml
  2. 19
      modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs

2
modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml

@ -31,7 +31,7 @@
{
<li>
<h3>
<a href="@(Model.DocumentsUrlPrefix + project.ShortName)">
<a href="@Model.GetUrlForProject(project)">
@project.Name
</a>
</h3>

19
modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs

@ -43,5 +43,24 @@ namespace Volo.Docs.Pages.Documents
return Page();
}
public string GetUrlForProject(ProjectDto project = null, string language = "en", string version = null)
{
var routeValues = new Dictionary<string, object> {
{ nameof(Project.IndexModel.Version), version ?? DocsAppConsts.Latest }
};
if (!_uiOptions.SingleProjectMode.Enable)
{
routeValues.Add(nameof(Project.IndexModel.ProjectName), project?.ShortName);
}
if (_uiOptions.MultiLanguageMode)
{
routeValues.Add(nameof(Project.IndexModel.LanguageCode), language);
}
return Url.Page("/Documents/Project/Index", routeValues);
}
}
}

Loading…
Cancel
Save