-
Notifications
You must be signed in to change notification settings - Fork 953
Add the custom search input partial #1512
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
Conversation
deining
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable to me.
e55ea7b to
e48d3b7
Compare
chalin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- See inline comment.
- Also, this new feature should be mentioned in the docs.
e48d3b7 to
4b4210e
Compare
4b4210e to
a0df1b8
Compare
|
I recently raised #2194 which is related. I think I would prefer if there was a guard for the custom search implementation instead of relying on the presence of It will also help downstream users to use the same parameter as a check while implementing other stuff in other layouts. Moreover, as mentioned in the issue, I would prefer to also override the search script in We can include the script in our |
|
@SayakMukhopadhyay et all: Thinking about the proposed solution in this PR, why not simply override |
@chalin That is indeed how things are implemented in the k8s website right now. In general, I have a personal preference for hooks over overriding. Hooks make it easier to upgrade. Docsy has some opinions on how layouts and especially CSS work with each other and keeping track of the changes while upgrading can become difficult, especially when the layouts are overridden. I have found that while upgrading if I have overridden a Docsy layout, I have to put a lot of thought into how that layout interacts with other layouts (which can be multiple and not too easy to find at times) and then change the overridden layout to match according. This is especially true for the Docsy 0.6 to 0.7 migration that we have to do. I do this by comparing the 0.6 and 0.7 layouts with the overridden layouts and then figuring out the changes that needed to be made. Having a hook means that the hooked layout can be self-contained to a degree and the changes in the layout calling the hook would not affect the hooked layout. At the same time, I understand that it's not feasible to add hooks everywhere but maybe it's possible in a few common places. |
|
Closing. For a statement of reasoning behind this, see #2194 (comment). |
This PR exposes a template (empty by default) for customizing the search input, which will be included if all existing search options were disabled.
The purpose of this PR is that avoid overriding the
layouts/partials/search-input.htmlwhich will make other search options unusable and hard to maintain on users/clients side.