Skip to content

Commit

Permalink
Fix search results page redirect issue (magento#7680)
Browse files Browse the repository at this point in the history
* Add search form and version logic

* Add version to versionless search page

* Update the theme gem
  • Loading branch information
belbiy authored Aug 7, 2020
1 parent 65f4968 commit 140a241
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
GIT
remote: https://github.com/magento-devdocs/devdocs-theme.git
revision: 1f85087df1b9be13ca98993aa433cae36c9d0059
revision: c96131acc7a0ed03629ab3401c8a64d819e7e610
specs:
devdocs (11)
devdocs (12)
jekyll (>= 4.0)

GEM
Expand Down
36 changes: 36 additions & 0 deletions src/_includes/layout/search-form.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{%- if page.guide_version == nil -%}
{%- assign search_version = site.version -%}
{% else %}
{%- assign search_version = page.guide_version -%}
{%- endif -%}

<form
class="spectrum-Search search-form"
action="{{ site.baseurl }}/guides/v{{ search_version }}/search.html"
>
<input
type="search"
placeholder="Looking for something specific?"
name="query"
value=""
class="spectrum-Textfield-input spectrum-Search-input search-field form-control"
autocomplete="off"
/>
<svg
class="spectrum-Icon spectrum-UIIcon-Magnifier spectrum-Search-icon"
focusable="false"
aria-hidden="true"
>
<rect fill="#ff13dc" opacity="0" width="18" height="18" /><path class="a" d="M16.5865,15.107,12.7,11.2215A6.413,6.413,0,1,0,11.2215,12.7l3.886,3.886a1.05,1.05,0,0,0,1.479-1.479ZM3,7.5A4.5,4.5,0,1,1,7.5,12,4.5,4.5,0,0,1,3,7.5Z" />
</svg>
<button type="reset" class="search-clear spectrum-ClearButton spectrum-SearchClearButton">
<svg
class="spectrum-Icon spectrum-UIIcon-CrossSmall"
focusable="false"
aria-hidden="true"
>
<rect fill="#ff13dc" opacity="0" width="18" height="18" /><path class="a" d="M13.2425,3.343,9,7.586,4.7575,3.343a.5.5,0,0,0-.707,0L3.343,4.05a.5.5,0,0,0,0,.707L7.586,9,3.343,13.2425a.5.5,0,0,0,0,.707l.707.7075a.5.5,0,0,0,.707,0L9,10.414l4.2425,4.243a.5.5,0,0,0,.707,0l.7075-.707a.5.5,0,0,0,0-.707L10.414,9l4.243-4.2425a.5.5,0,0,0,0-.707L13.95,3.343a.5.5,0,0,0-.70711-.00039Z" />
</svg>
</button>
</form>

1 change: 1 addition & 0 deletions src/search.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
layout: search
title: Search Results
guide_version: "2.4"
---

0 comments on commit 140a241

Please sign in to comment.