MarkBind / markbind

MarkBind is a tool for generating content-heavy websites from source files in Markdown format
https://markbind.org/
MIT License
135 stars 124 forks source link

Support search bar in siteNav #973

Closed damithc closed 3 years ago

damithc commented 4 years ago

v2.9.0 Current: the search bar is in the topNav Problem: user needs to scroll to top before searching Suggestion: provide a way to insert a search bar into the siteNav (which has a sticky behavior compared to topNav)

yash-chowdhary commented 4 years ago

I'm not sure, but can this issue be resolved by just hardcoding the search bar into the template site-nav.md file? This way every website created would have it if initialized with the default template. The change I made to site-nav.md is reflected here -

Screenshot 2020-01-15 at 1 42 43 PM

Does this meet the requirement, or is there something else that this issue was targeting?

le0tan commented 4 years ago

We can provide an option to stick the navbar on the screen so that the search bar is always accessible, reference design is described in #980

damithc commented 4 years ago

Being able to add a search box to the siteNav is good enough me. I tried adding the one and here are the problems I encountered:

Search results get clipped. image

Doesn't seem to work with Algolia search.

<form class="navbar-form">
  <searchbar placeholder="Search" algolia menu-align-left></searchbar>
</form>

image

ang-zeyu commented 4 years ago

this is tricky https://stackoverflow.com/questions/11520728/overflow-yvisible-not-working-when-overflow-xhidden-is-present

damithc commented 4 years ago

I see. May be not a big issue if the TopNav can be reliably fixed to the stop as users can easily access the search bar through the TopNav.

ang-zeyu commented 3 years ago

now possible with the new layouts system #1403, as overflow can be set just on the <site-nav> component itself

I've ensured this works with the user guide and markbind init templates, but left the search bar on the top right