Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/spech66/bootstrap-bp-hugo-startpage.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pech <windows@spech.de>2020-01-14 19:55:09 +0300
committerGitHub <noreply@github.com>2020-01-14 19:55:09 +0300
commit3f0300363a8cb9a3507c9325d13ca443702fb9fd (patch)
treecd1b2ec4d9af6ba54510f9e57dce56572bd4586b
parentbb8cfd704dbe081135ae0295141443819dedf345 (diff)
parentb2cbba20ba1ba58fc729560c8b4fcac2171dcac7 (diff)
Merge pull request #4 from Quentinchampenois/refactor/index-search-bar
Add loop for search engines in index
-rw-r--r--layouts/index.html24
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 }}