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

Site search (searchbar) #238

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Site search (searchbar) #238

wants to merge 5 commits into from

Conversation

lunarias
Copy link
Collaborator

@lunarias lunarias commented Dec 6, 2024

Description

  • Added Search component that allows the page meta data to be discoverable in a search component. Search results are prioritized by title then descriptions.

Pictures/Videos

@alereyes2 alereyes2 force-pushed the searchbar-v1 branch 5 times, most recently from f2c6c54 to 9117f65 Compare January 25, 2025 00:07
Copy link
Collaborator

@zoltan-dulac zoltan-dulac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few things to look at here.


//import data from "./search.json";
const search = new (function() {
//const FlexSearch = require('flexsearch');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an es6 version of this file?

}

this.init = () => {
body.addEventListener('click', this.handleClick);
Copy link
Collaborator

@zoltan-dulac zoltan-dulac Jan 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you made sure this works with a keyboard (I am not sure this works in that case, so I thought I'd ask).

When I used this with a keyboard a few weeks ago, there was a problem. Can you double check?

}
}

export default search;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not something to correct, but a comment: your code is very easy to understand. I may put you on PRs of other people's work to help with code quality.

@@ -1,3 +1,5 @@
<link rel="stylesheet" type="text/css" href="css/form.css" >
<link rel="stylesheet" type="text/css" href="css/site-search.css" >
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • These should be in the file common-head-tags.php, since they should be inside the <head> tag.
  • Since you are probably not going to be the only one to make this mistake, we should add documentation in the README.md about adding global JS and CSS for all pages. (The global JS isssue is covered in another comment of this code review). Can you please add that as part of this PR?

import search from '../../js/modules/site-search.js';
search.init();
</script>

Copy link
Collaborator

@zoltan-dulac zoltan-dulac Jan 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I would like to ensure any external scripts involved are not included via CDN (If there is another case of this outside of your PR, we should remove that). Let's include this in our package.json. Please follow the instructions in the documention when adding a front-end NPM package to our project. (I have noticed the formatting of the bolded text in the glider example in the docs is wanting -- let's discuss in the next standup how to fix that as part of your PR).
  • The <script> tags should be in end of footer.php

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