Skip to content

Commit

Permalink
search: add a link to the search howto page
Browse files Browse the repository at this point in the history
This adds a link from the site's search widget to a guide which
demonstrates the different search operators that the reader can use to
narrow down their search results.

The link is visible on /search/, as well as any page that embeds the
search widget (such as /docs/howto/). It is not visible in the page
header's search widget (because I'm not yet sure how to make that
change), but an equivalent link could probably be added to that popup
element if this link proves to be useful to users.

Also: remove a pointless redirect when the "search" link is used from
the site's 404 page.

Closes cue-lang/docs-and-content#1.

Preview-Path: /search/
Preview-Path: /docs/howto/
Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: Ibe287f58295320141448574a1b91f8bd9ec00b14
Dispatch-Trailer: {"type":"trybot","CL":1206957,"patchset":2,"ref":"refs/changes/57/1206957/2","targetBranch":"master"}
  • Loading branch information
jpluscplusm authored and cueckoo committed Jan 13, 2025
1 parent 1828f9e commit cc353f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hugo/i18n/en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ other = """
Oops! This page doesn't exist.<br><br>
Try going back to our <strong><a href="/">home page</a></strong>,
taking a look at our <strong><a href="/docs/">documentation</a></strong>,
or <a href="/search">searching for a page</a></strong>.
or <a href="/search/">searching for a page</a></strong>.
"""

# Search
Expand All @@ -99,6 +99,8 @@ other = "What are you looking for?"
other = "documents found"
[search_filters_title]
other = "Filters"
[search_help_link_text]
other = "How can I customize this search?"
[search_placeholder]
other = "Search in cuelang.org"
[search_placeholder_content_type]
Expand Down
1 change: 1 addition & 0 deletions hugo/layouts/partials/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
</div>

<div class="search__filters">
<p class="search__filters-title"> <a href="/docs/howto/search-this-site/">{{ T "search_help_link_text" }}</a></p>
<p class="search__filters-title"> {{ T "search_filters_title" }}</p>

{{- partial "filter.html" (dict
Expand Down

0 comments on commit cc353f3

Please sign in to comment.