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 20:10:37 +0300
committerSebastian Pech <windows@spech.de>2020-01-14 20:10:37 +0300
commit223567f418a68823f61ecff6ac69b7cc322758a7 (patch)
treef95ba27fc7168b47d47e3dcf3852c2b69aafbfde
parent3f0300363a8cb9a3507c9325d13ca443702fb9fd (diff)
New searchEngines syntax
-rw-r--r--README.md22
-rw-r--r--exampleSite/config.toml18
-rw-r--r--layouts/index.html2
3 files changed, 34 insertions, 8 deletions
diff --git a/README.md b/README.md
index 1fbe418..063bdc3 100644
--- a/README.md
+++ b/README.md
@@ -24,11 +24,27 @@ You can get a zip of the latest version of the theme from the [home page](https:
Most settings should be done with hugo specific variables. There are only a few (optional) additional `[params]`.
* `welcomeText = "Startpage!"` is the text above the search box
-* `showGoogleSearch = true` to switch Google search box on/off
-* `showBingSearch = true` to switch Bing search box on/off
-* `showDuckDuckGoSearch = true` to switch DuckDuckGo search box on/off
* `startPageColumns = true` will show the start page in grouped lists
+Activate the search engine you want to use (or add a new one).
+
+```toml
+[[params.searchEngines]]
+ name = "Google"
+ activated = true
+ url = "https://www.google.com/search"
+
+[[params.searchEngines]]
+ name = "DuckDuckGo"
+ activated = true
+ url = "https://duckduckgo.com/"
+
+[[params.searchEngines]]
+ name = "Bing"
+ activated = true
+ url = "https://www.bing.com/search"
+```
+
![startPageColumns = false](https://raw.githubusercontent.com/spech66/bootstrap-bp-hugo-startpage/master/images/screenshot.png)
![startPageColumns = true](https://raw.githubusercontent.com/spech66/bootstrap-bp-hugo-startpage/master/images/screenshot2.png)
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 108b946..b336b28 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -27,6 +27,18 @@ paginate = 5
#images = ["logo.jpg"]
startPageColumns = true
welcomeText = "Bootstrap-BP hugo startpage"
- showGoogleSearch = false
- showBingSearch = false
- showDuckDuckGoSearch = true
+
+[[params.searchEngines]]
+ name = "Google"
+ activated = true
+ url = "https://www.google.com/search"
+
+[[params.searchEngines]]
+ name = "DuckDuckGo"
+ activated = true
+ url = "https://duckduckgo.com/"
+
+[[params.searchEngines]]
+ name = "Bing"
+ activated = true
+ url = "https://www.bing.com/search"
diff --git a/layouts/index.html b/layouts/index.html
index bbc85b1..a2bf444 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -2,7 +2,6 @@
<h1 class="welcomeText">{{ .Site.Params.welcomeText }}</h1>
-
{{ if .Site.Params.searchEngines }}
{{ range .Site.Params.searchEngines }}
{{ if .activated }}
@@ -13,7 +12,6 @@
{{ end }}
{{ end }}
-
{{ if .Site.Params.startPageColumns }}
<div id="groupList" class="card-deck mt-3">
{{ range .Site.Data.links }}