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

Increase Snippet's Truncate number to higher value, or remove that if possible from search.json #401

Closed
4 tasks done
arunshariharan opened this issue Aug 31, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@arunshariharan
Copy link

Checklist

  • I have read the contributing guidelines.
  • There are no similar request on existing issues (including closed ones).
  • I have read the project progress and know the current progress of the project.
  • I was in the master branch of the latest code.

Is your feature request related to a problem? Please describe

I am writing posts that are longer than 300 words, but the search functionality limits the snippet to truncate:300, which means only 1/3rd of my content in each post is searchable.

Describe the solution you'd like

Can we remove the truncate option form search.json or increase the limit around 1000?

Describe alternatives you've considered

If it is not feasible due to optimization concerns, I was thinking of modifying the search.json locally myself for my build (create assets/js/data/search.json), but unfortunately jekyll does not pickup the changes and replace it while building. I am happy to know if there are any other options to go about it, if changing this is not feasible.

Additional context

@arunshariharan arunshariharan added the enhancement New feature or request label Aug 31, 2021
@cotes2020
Copy link
Owner

Hi @arunshariharan,

If you want full text search, you can actually remove the filtertruncate. I used the filter in the project to prevent too much post content from being displayed in the search results (in fact, this can be restricted by CSS, and it has already been implemented).

In addition, I checked the latest version of Simple-Jekyll-Search. The docs also listed the usage of full-text search. I will upgrade the version of it later. Thanks for your report :)

@arunshariharan
Copy link
Author

@cotes2020 Thanks so much for this! Can't wait for the update to roll out :)

Also if I remove the truncate locally it works fine locally. But when I push to github, wouldn't it pull the latest gem and compile that anyway? So all changes locally I do will be lost when I push to github right? Is there a way to override this?

@cotes2020
Copy link
Owner

Until the next gem release, you can temporarily overwrite the contents of the theme's gem with a file of the same name. See: https://jekyllrb.com/docs/themes/#overriding-theme-defaults

@arunshariharan
Copy link
Author

Thanks so much 😄

cotes2020 added a commit that referenced this issue Oct 22, 2021
@joshjohanning joshjohanning mentioned this issue Oct 31, 2022
4 tasks
ambersun1234 pushed a commit to ambersun1234/chirpy.ambersun1234.github.io that referenced this issue Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants