Option to include excerpt
musicin3d opened this issue · 0 comments
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.