Open Deng-Xian-Sheng opened 5 months ago
If the "content = doc.querySelector('#content').querySelector('article').textContent" in the first 100 lines does not work properly, try changing it to "content = doc.querySelector('article').textContent"
Please merge after the main branch test is functioning properly.
I have modified the language of the comments and the images.
Once again, please start the project locally and ensure the search function is working properly before merging into the main branch.
As for why this is necessary, actually, it works fine on my blog, there's no problem with that. However, the theme of my blog is slightly different from your official theme. I made modifications (using Hugo's feature layouts/posts/single.html), so I haven't tested this search function on the official theme (completely unchanged). I believe this is something you should do.
I'm too tired to test this for the official theme.
As mentioned before: If the "content = doc.querySelector('#content').querySelector('article').textContent" in the first 100 lines does not work properly, try changing it to "content = doc.querySelector('article').textContent".
Please merge after the main branch test is functioning properly.
This is also reflected in the code comments.
I hope it works well on the blogs of thousands of people.
As shown in the figure