-
Notifications
You must be signed in to change notification settings - Fork 868
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat!: search improvements * Make it opt-in via _searchIndexUseMetadata --------- Co-authored-by: Yufei Huang <[email protected]>
- Loading branch information
Showing
8 changed files
with
225 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Collections.Immutable; | ||
using System.Composition; | ||
using Docfx.Build.Common; | ||
using Docfx.DataContracts.ManagedReference; | ||
using Docfx.Plugins; | ||
|
||
namespace Docfx.Build.ManagedReference; | ||
|
||
[Export(nameof(ManagedReferenceDocumentProcessor), typeof(IDocumentBuildStep))] | ||
public class FillMetadata : BaseDocumentBuildStep | ||
{ | ||
public override string Name => nameof(FillMetadata); | ||
public override int BuildOrder => 0x30; | ||
|
||
public override void Postbuild(ImmutableList<FileModel> models, IHostService host) | ||
{ | ||
if (models.Count > 0) | ||
{ | ||
foreach (var model in models) | ||
{ | ||
if (model.Type != DocumentType.Article) | ||
{ | ||
continue; | ||
} | ||
|
||
model.ManifestProperties.Uid = null; | ||
var pageViewModel = (PageViewModel)model.Content; | ||
if (pageViewModel.Items.Count == 0) | ||
{ | ||
continue; | ||
} | ||
|
||
model.ManifestProperties.IsMRef = true; | ||
model.ManifestProperties.Title = pageViewModel.Items[0].FullName; | ||
model.ManifestProperties.Summary = pageViewModel.Items[0].Summary; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.