Resolve "Add inclusion/exclusion tags to page templates"
What does this MR do and why?
Describe why, not just what. Include links to relevant issues or discussions.
This MR adds HTML data tags called "data-elastic-exclude" and "data-elastic-include".
data-elastic-exclude
-> for content that you DON'T want ES to index
data-elastic-include
-> for content that you DO want ES to index
Focused on templates that were not considered "main content"
We don't really want ES to index the following files
- 404
- banner
- feedback
- home page (just didn't think the text here on home page didn't matter for search)
For single.html
I excluded everything BUT the ".Content" (this is the main page content which we want search to index!). So I added the data attribute include for an extra check.
In search-results.html, only added the exclusion to the partial footer.html.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/technical-writing-group/gitlab-docs-hugo/-/blob/main/doc/setup.md. -
Configure .zshrc
file to have all the necessary information for elastic search API setup (refer to MR !201 (diffs))
Merge request acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this merge request.
Closes #126 (closed)