Skip to content

Commit

Permalink
feat: add the search form widget
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Aug 5, 2022
1 parent 41c0dc4 commit cdb71a8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions exampleSite/layouts/partials/hooks/sidebar-begin.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{- partial "sidebar/search-form" . }}
15 changes: 15 additions & 0 deletions layouts/partials/sidebar/search-form.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- $page := .Site.GetPage "search" -}}
{{- if $page }}
<div class="row component card">
<div class="card-body">
<form action="{{ $page.Permalink }}">
<div class="input-group">
<input name="q" class="form-control" placeholder="{{ i18n "search" }}">
<button class="btn btn-sm btn-search position-absolute end-0 border-0 border-start border-secondary p-2" type="submit">
<i class="fas fa-fw fa-search text-primary"></i>
</button>
</div>
</form>
</div>
</div>
{{- end }}

0 comments on commit cdb71a8

Please sign in to comment.