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

Option to include excerpt #68

Open
musicin3d opened this issue Sep 8, 2020 · 0 comments · May be fixed by #84
Open

Option to include excerpt #68

musicin3d opened this issue Sep 8, 2020 · 0 comments · May be fixed by #84

Comments

@musicin3d
Copy link

I have a site that doesn't want to include all article contents in search.json. We want to keep the size of the json down, and we don't want to make it easier for scrapers to duplicate the content. However, also want better search results that we would get from only using the titles.

We accomplish this by including the excerpts. https://hexo.io/docs/variables#Page-Variables

A new config option should suffice: search.excerpts

It can default to false. Setting it to true would include excerpts where available.

Does anyone have an opinion on how to handle posts that don't have excerpts? It would be easier to implement local searching if the field was included as an empty string, but it would save file size and download time if the field was excluded.

I might go ahead and submit a PR next weekend, so I would love some feedback before then.

crycode-de added a commit to crycode-de/hexo-generator-search that referenced this issue Apr 8, 2024
@crycode-de crycode-de linked a pull request Apr 8, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants