hexo-theme-doc
hexo-theme-doc copied to clipboard
Can I pre-populate search via the URL?
(Loving this theme, folks! Thank you.)
I have a use case where previously we were linking to "mydocs.com?q=search term" to drive users to search, and I'd like to duplicate that feature here. I've gotten so far as translating "myhexodocs.com#search=search term" to pluck out "search term" and enter it into the search box, but I'm having trouble using JS/jQuery to trigger the keyup and run the search.
Is there a better way of doing this, do you know? Is there some JS function that I can trigger to just say "search for X" or even to just run the search after I've pre-populated the search bar?
@karlhinze Thanks. Will be a nice feature to introduce. No there isn't a way to do that programmatically, the feature must be implemented in the core code-base first. We will consider to introduce this feature in the next milestone, I will let you know.
Cheers.