Browse Source

docs search fix

pull/3853/head
Armağan Ünlü 6 years ago
parent
commit
0d949894a1
  1. 50
      modules/docs/src/Volo.Docs.Web/Pages/Documents/Search.cshtml

50
modules/docs/src/Volo.Docs.Web/Pages/Documents/Search.cshtml

@ -48,31 +48,35 @@
<div class="p-5 card-body"> <div class="p-5 card-body">
@foreach (var docs in Model.SearchOutputs) @foreach (var docs in Model.SearchOutputs)
{ {
<div class="pb-4 small"> <div class="row">
@functions <div class="col">
<div class="pb-4 small">
@functions
{ {
string RemoveFileExtensionFromPath(string path) string RemoveFileExtensionFromPath(string path)
{ {
if (path == null) if (path == null)
{ {
return null; return null;
} }
return path.EndsWith("." + @Model.Project.Format) return path.EndsWith("." + @Model.Project.Format)
? path.Left(path.Length - Model.Project.Format.Length - 1) ? path.Left(path.Length - Model.Project.Format.Length - 1)
: path; : path;
} }
} }
<h5 class="mb-3"> <h5 class="mb-3">
<a href="/@Model.LanguageCode/@Model.ProjectName/@Model.Version/@RemoveFileExtensionFromPath(docs.Name)"> <a href="/@Model.LanguageCode/@Model.ProjectName/@Model.Version/@RemoveFileExtensionFromPath(docs.Name)">
@RemoveFileExtensionFromPath(docs.Name) @RemoveFileExtensionFromPath(docs.Name)
</a> </a>
</h5> </h5>
<div class="mb-4"> <div class="mb-4">
@foreach (var highlight in docs.Highlight) @foreach (var highlight in docs.Highlight)
{ {
<p class="mb-2">@Html.Raw(highlight)</p> <p class="mb-2">@Html.Raw(highlight)</p>
} }
</div>
</div>
</div> </div>
</div> </div>
} }

Loading…
Cancel
Save