Skip to content

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

  1. 404
  2. banner
  3. feedback
  4. 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.

image.png

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/technical-writing-group/gitlab-docs-hugo/-/blob/main/doc/setup.md.
  2. 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.

Closes #126 (closed)

Edited by Hiru Fernando

Merge request reports

Loading