Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

filzrev
Copy link
Contributor

@filzrev filzrev commented Jul 1, 2024

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
Copy link
Contributor

yufeih commented Jul 8, 2024

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

@filzrev
Copy link
Contributor Author

filzrev commented Jul 9, 2024

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

Currently DocfOption 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.
So I hope it can be customize search by custom template.

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.

2 participants