-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Implement search page #1488
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
Implement search page #1488
Conversation
@phanan Would you mind reviewing this? I think this review requires more design expertise and that's definitely an area where you excel far beyond me. 😄 |
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.
@NoelDeMartin very nice implementation, thanks! I have a couple of question though:
- Is it meant to be an orphan page? I see no link to get to the page (I'm not familiar with how DuckDuckGo works FWIW)
- Can/should we update the URL with every search input change? Right now they're out of sync.
- Is there a reason why menu and sponsor info are hidden from the page?
themes/vue/layout/search-page.ejs
Outdated
<input | ||
class="search-query" | ||
v-model="search" | ||
placeholder="Search VueJS" |
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.
I'd suggest just "Search" or "Search Vue.js" here.
themes/vue/layout/search-page.ejs
Outdated
|
||
</div> | ||
|
||
<script src="//cdn.jsdelivr.net/algoliasearch/3/algoliasearch.min.js"></script> |
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.
These should always be https://
regardless of the original site protocol.
themes/vue/layout/search-page.ejs
Outdated
var version = match ? match[1] : 'v2' | ||
var algolia = algoliasearch('BH4D9OD16A', '85cc3221c9f23bfbaa4e3913dd7625ea') | ||
var algoliaHelper = algoliasearchHelper(algolia, 'vuejs', { | ||
hitsPerPage: 15, |
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.
We use 2-space indentation (both JS and HTML) for our docs, can you please check?
themes/vue/layout/search-page.ejs
Outdated
}, | ||
methods: { | ||
addPage() { | ||
algoliaHelper.setCurrentPage(this.lastPage+1).search() |
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.
Space around +
Ok I have applied the changes you mentioned, to answer your questions:
And about the https links, I did it like the search on the top is implemented now, so maybe you want to update it as well:
|
|
I think it being an orphan is fine. If people want to search while already on the site, there's already a search bar available at the top, so people might only use a dedicated search page when being directed from other services like DuckDuckGo. |
4c7195c
to
09a349e
Compare
Ok I have added the push history behaviour and sponsors information. I have adblock installed and seems like sponsors are treated as ads, because I wasn't seeing them anywhere. That explains why I couldn't see them anywhere other than the sponsors page. |
You can (and should) totally disable adblock for the site to test it.
2018-03-19 9:13 GMT+00:00 Noel De Martin <notifications@github.com>:
… Ok I have added the push history behaviour and sponsors information. I
have adblock installed and seems like sponsors are treated as ads, because
I wasn't seeing them anywhere. That explains why I couldn't see them
anywhere other than the sponsors page.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#1488 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AHrt0gjJUseXZfgEnyYXLVe5kB53eOMWks5tf3a-gaJpZM4SqXB6>
.
|
Yeah of course, I already did, I didn't think about it before but now that I noticed I have it whitelisted. |
LGTM now, thanks a lot! If we could have arrow-key navigation for the results, it would be even better, but I believe this is good enough for now. |
& + .breadcrumb::before | ||
content: "\203A\A0" | ||
margin-left: 5px | ||
color: $light |
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.
Oh, we need an EOL here btw.
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.
done 👍
Cool, thanks :D. Yeah I think arrow navigation and adding a "view more results" link in top bar search would be good improvements in the future. |
nice page! |
One quick note: if I press Enter in the search input, it currently refreshes the page and clears the search. Could we instead have it match the behavior of the top search bar, where Enter takes you to the first result? |
@chrisvfritz Yeah that's a good idea, and easy to implement. You can test in on the last commit. |
Fantastic! A few other notes:
|
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.
The page is missing the 'search by Algolia' logo which is mandatory.
@chrisvfritz Yeah, the sidebar layout looks weird, but I needed to add it because the sponsors section is located inside of the sidebar. The thing is that it has a fixed position, so it could technically be outside of the sidebar, but on mobile it is inside of the menu so I'm not sure how to go about it, I guess someone who's worked more with the site can have a better opinion. I also removed what appears by default in the sidebar, because it was a menu with only one section so I thought it'd be better to show nothing instead. I can change the text on the search box once it's decided 100%, because I already changed it once. I still vote for using "Search VueJS" which was my initial proposal, but I don't mind which one you want to put either way. @Akryum I didn't know it was mandatory, I'll do it in then. |
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.
Added "search by algolia". In the symfony page seems like they have a custom url for that: https://www.algolia.com/cc/symfony?hi=symfony&utm_source=symfony&utm_medium=link&utm_campaign=symfony_search but I couldn't find one for vue so I left algolia homepage for now.
& + .breadcrumb::before | ||
content: "\203A\A0" | ||
margin-left: 5px | ||
color: $light |
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.
done 👍
@chrisvfritz Is there anything else needed for this to be merged? |
Nope, thanks for the ping. This just fell off my radar. 🙂 |
Implementation for issue #1087. The url would be
https://vuejs.org/v2/search/?q={{search query}}
.I have never worked with algolia nor hexo before, so please check that I didn't miss anything. I think the styles could also be improved. And I tried to follow the coding style the best I could (like not using semicolon), but I may have missed something.
In any case, I'll be happy to fix anything that you consider so please let me know what you think :D.