Skip to content

feat: Support search.min.js script customize functionality - #10055

Merged
vicancy merged 1 commit into
dotnet:mainfrom
filzrev:feat-support-search-script-customization
Sep 24, 2026
Merged

vicancy merged 1 commit into
dotnet:mainfrom
filzrev:feat-support-search-script-customization

Conversation

@filzrev

@filzrev filzrev commented Jul 1, 2024 •

Copy link
Copy Markdown
Collaborator

This PR intended to support search.min.js script customization.

Currently docfx modern template bundle scripts to docfx.min.js.
So it can't customize search scripts with custom template.

This PR exclude search.ts file from bundling by adding following settings

  • Set modern/src/search.ts' as entryPointsto separately createsearch.min.js`.
  • Rewrite ./search import statement settings by custom esbuild plugin.
    • Set external property to true to exclude from esbuild bundle
    • Rewrite path from ./search to ./search.min.js

Additionally this PR fix .NET runtime version to .NET 8 (that used by npm run start)

@yufeih

yufeih commented Jul 8, 2024

Copy link
Copy Markdown
Contributor

Should we instead expose a callback method in DocfxOption for custom search implementation? That options object is the pattern for customizing JS behaviors.

@filzrev

filzrev commented Jul 9, 2024 •

Copy link
Copy Markdown
Collaborator Author

Should we instead expose a callback method in DocfxOption for custom search implementation? That options object is the pattern for customizing JS behaviors.

Currently DocfxOption settings are configuration is supported by main.js customization only.

On my use case. I want to switch search engine from lurn based search to PageFind based search by custom template.
In this case. user who use main.js need to copy related code from custom template/main.js.
So I hope it can be customize search by custom template.

@filzrev
filzrev force-pushed the feat-support-search-script-customization branch 2 times, most recently from 5d81fce to 1b3917b Compare October 21, 2024 09:48
@filzrev
filzrev force-pushed the feat-support-search-script-customization branch from 1b3917b to fc6ca21 Compare February 18, 2025 09:11
@filzrev
filzrev force-pushed the feat-support-search-script-customization branch 3 times, most recently from 34e5291 to eb69853 Compare March 11, 2025 04:10
@PanzerFowst

Copy link
Copy Markdown

Any blockers on this PR?

@filzrev
filzrev force-pushed the feat-support-search-script-customization branch from eb69853 to eb962d8 Compare April 6, 2025 17:37
@filzrev
filzrev force-pushed the feat-support-search-script-customization branch from eb962d8 to a3ef221 Compare April 30, 2025 07:02
@filzrev
filzrev force-pushed the feat-support-search-script-customization branch from a3ef221 to 51d13ab Compare May 25, 2025 10:29
@filzrev
filzrev force-pushed the feat-support-search-script-customization branch from 51d13ab to 32b2f0e Compare January 15, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants