Skip to content

Commit

Permalink
chore: update init to use _enableSearch
Browse files Browse the repository at this point in the history
  • Loading branch information
yufeih committed Nov 6, 2023
1 parent 0f16aae commit 1d7b96c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Docfx.App/Helpers/DocumentBuilderWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static void BuildDocument(BuildJsonConfig config, BuildOptions options, T
var postProcessorNames = config.PostProcessors.ToImmutableArray();
var metadata = config.GlobalMetadata?.ToImmutableDictionary();

// For backward compatible, retain "_enableSearch" to globalMetadata though it's deprecated
// Ensure "_enableSearch" adds the right post processor
if (metadata != null && metadata.TryGetValue("_enableSearch", out object value))
{
if (value is bool isSearchable && isSearchable && !postProcessorNames.Contains("ExtractSearchIndex"))
Expand Down
4 changes: 2 additions & 2 deletions src/docfx/Models/InitCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ This utility will walk you through creating a docfx project.
{
_appName = name,
_appTitle = name,
_enableSearch = search,
pdf,
},
postProcessors = search ? new[] { "ExtractSearchIndex" } : null,
}
}
};

Expand Down

0 comments on commit 1d7b96c

Please sign in to comment.