diff options
author | quentinchampenois <quentin.champenois@eemi.com> | 2020-01-11 21:02:48 +0300 |
---|---|---|
committer | quentinchampenois <quentin.champenois@eemi.com> | 2020-01-11 21:02:48 +0300 |
commit | b2cbba20ba1ba58fc729560c8b4fcac2171dcac7 (patch) | |
tree | cd1b2ec4d9af6ba54510f9e57dce56572bd4586b /layouts | |
parent | bb8cfd704dbe081135ae0295141443819dedf345 (diff) |
add loop for search engines in index
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/index.html | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/layouts/index.html b/layouts/index.html index bf45276..bbc85b1 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -2,22 +2,18 @@ <h1 class="welcomeText">{{ .Site.Params.welcomeText }}</h1> -{{ if .Site.Params.showGoogleSearch }} -<form id="search-form-g" action="https://www.google.com/search" method="get"> - <input id="search-bar" class="form-control" type="text" autofocus type="text" placeholder="Search Google" name="q" alt="Search Google" onkeydown="if(event.keyCode === 13) { this.form.submit(); return false; }"> -</form> -{{ end }} -{{ if .Site.Params.showBingSearch }} -<form id="search-form-b" action="https://www.bing.com/search" method="get"> - <input id="search-bar" class="form-control" type="text" autofocus type="text" placeholder="Search Bing" name="q" alt="Search Bing" onkeydown="if(event.keyCode === 13) { this.form.submit(); return false; }"> -</form> -{{ end }} -{{ if .Site.Params.showDuckDuckGoSearch }} -<form id="search-form-ddg" action="https://duckduckgo.com/" method="get"> - <input id="search-bar" class="form-control" type="text" autofocus type="text" placeholder="Search DuckDuckGo" name="q" alt="Search DuckDuckGo" onkeydown="if(event.keyCode === 13) { this.form.submit(); return false; }"> -</form> + +{{ if .Site.Params.searchEngines }} + {{ range .Site.Params.searchEngines }} + {{ if .activated }} + <form id="search-form-{{ .name }}" class="mb-3" action="{{ .url }}" method="get"> + <input id="search-bar-{{ .name }}" class="form-control" type="text" autofocus type="text" placeholder="Search {{ .name }}" name="q" alt="Search {{ .name }}" onkeydown="if(event.keyCode === 13) { this.form.submit(); return false; }"> + </form> + {{ end }} + {{ end }} {{ end }} + {{ if .Site.Params.startPageColumns }} <div id="groupList" class="card-deck mt-3"> {{ range .Site.Data.links }} |