Skip to content

Hugo: add searchTerm option to search shortcode #489

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JuanUsMedia
Copy link
Collaborator

  • Add searchTerm to example page
  • Pass searchTerm from search shortcode, through search partial, to filter partial
  • Set initial searchItem with search filter

To test:

  • Navigate to /examples/shortcodes/search and verify that the search results are accurate.

Fixes cue-lang/cue#3566

Copy link

netlify bot commented Apr 28, 2025

Deploy Preview for cue ready!

Name Link
🔨 Latest commit 9bc6197
🔍 Latest deploy log https://app.netlify.com/sites/cue/deploys/68220794ed844a0008bbed93
😎 Deploy Preview https://deploy-preview-489--cue.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@JorindeUsMedia JorindeUsMedia left a comment

Choose a reason for hiding this comment

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

Overall looks good! Just 1 testcase where it doesnt work: searchTerm set but not tags pre-selected

Copy link
Collaborator

@JorindeUsMedia JorindeUsMedia left a comment

Choose a reason for hiding this comment

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

The only edge case which I found while testing: Remove all preselected terms & tags: the search will reset to the preselected filters & term. There is no way to empty it. But I don't know how to fix that because on page load there is also no search term and than the preselected term kicks in: that's what we want. There's no way to know now if the user emptied it or if we started fresh. It's also preselected for a reason :)

@JuanUsMedia JuanUsMedia marked this pull request as ready for review May 8, 2025 06:17
@JuanUsMedia JuanUsMedia requested a review from cueckoo as a code owner May 8, 2025 06:17
@JuanUsMedia JuanUsMedia requested a review from jpluscplusm May 8, 2025 06:18
Copy link
Collaborator

@jpluscplusm jpluscplusm left a comment

Choose a reason for hiding this comment

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

LGTM! Please just fix the DCO and my last comment, and I'll submit this :-)

* Add searchTerm to example page
* Pass searchTerm from search shortcode,
through search partial, to filter partial
* Set initial searchItem with search filter

To test:
* Navigate to /examples/shortcodes/search and verify that the search results are accurate.

Fixes cue-lang/cue#3566

Signed-off-by: juanstelling <[email protected]>
Copy link
Collaborator

@jpluscplusm jpluscplusm left a comment

Choose a reason for hiding this comment

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

LGTM - I'll import into Gerrit after we've resolved the unrelated CI test failures.

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.

cuelang.org: allow an author to predefine the text in a search box
3 participants