-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: separate styles from main HB bundle
feat: add the hb.search.modal parameter to enable/disable modal, default to true feat: add the form partial style: tweak the search layout
- Loading branch information
Showing
7 changed files
with
52 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{{- define "title" }} | ||
{{- printf "%s - %s" (i18n "search") .Site.Title -}} | ||
{{- end }} | ||
|
||
{{- define "main" }} | ||
{{ partial "hb/modules/search/assets/css" . }} | ||
<div class="hb-module"> | ||
{{ partial "search/index" . }} | ||
</div> | ||
{{ partial "search/assets/js" . }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{{- $rtl := eq .Language.LanguageDirection "rtl" }} | ||
{{- $opts := dict | ||
"targetPath" (cond $rtl "css/search.rtl.css" "css/search.css") | ||
"outputStyle" (cond hugo.IsProduction "compressed" "") | ||
"vars" (dict | ||
"prefix" (default "hb" site.Params.hb.styles.prefix) | ||
) | ||
}} | ||
{{- $css := resources.Get "hb/modules/search/index.scss" | toCSS $opts }} | ||
{{- if hugo.IsProduction }} | ||
{{- $css = $css | fingerprint }} | ||
{{- end }} | ||
<link rel="stylesheet" href="{{ $css.RelPermalink }}" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{{- $url := partial "search/functions/search-url" . }} | ||
<form class="hb-module hb-search-form position-relative" action="{{ $url }}"> | ||
<input name="q" class="form-control form-control-lg pe-5" placeholder="{{ i18n `search` }}"> | ||
<button | ||
type="submit" | ||
class="position-absolute end-0 top-0 mt-4 me-4 p-0 border-0 bg-transparent" | ||
title="{{ i18n `search` }}"> | ||
{{ partial "icons/icon" (dict "vendor" "bs" "name" "search" "width" "1.5rem" "height" "1.5rem") }} | ||
</button> | ||
</form> |
3 changes: 3 additions & 0 deletions
3
layouts/partials/hugopress/modules/hb-search/hooks/body-end.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{{- if default true site.Params.hb.search.modal }} | ||
{{ partial "search/assets/js" .Page }} | ||
{{- end }} |
3 changes: 3 additions & 0 deletions
3
layouts/partials/hugopress/modules/hb-search/hooks/head-end.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{{- if default true site.Params.hb.search.modal }} | ||
{{ partial "hb/modules/search/assets/css" .Page }} | ||
{{- end }} |