diff --git a/config.yaml b/config.yaml index 118ac7a8b..6545e91ce 100644 --- a/config.yaml +++ b/config.yaml @@ -100,3 +100,15 @@ related: weight: 100 threshold: 80 toLower: false + +outputFormats: + JSON: + mediaType: "application/json" + baseName: "search-index" # This ensures the output file is named search-index.json + isPlainText: true + +outputs: + home: + - HTML + - JSON + diff --git a/content/english/search/_index.md b/content/english/search/_index.md new file mode 100644 index 000000000..978d64630 --- /dev/null +++ b/content/english/search/_index.md @@ -0,0 +1,4 @@ +--- +title: "Search the Site" +description: "Find what you're looking for quickly and easily." +--- diff --git a/content/svenska/search/_index.md b/content/svenska/search/_index.md new file mode 100644 index 000000000..b66458643 --- /dev/null +++ b/content/svenska/search/_index.md @@ -0,0 +1,4 @@ +--- +title: "Sök på webbplatsen" +description: "Hitta snabbt och enkelt det du letar efter." +--- diff --git a/layouts/_default/index.json b/layouts/_default/index.json new file mode 100644 index 000000000..f519b06cd --- /dev/null +++ b/layouts/_default/index.json @@ -0,0 +1,14 @@ +[ + {{- $pages := .Site.RegularPages -}} + {{- range $index, $page := $pages -}} + {{- if $index }},{{ end }} + { + "title": {{ $page.Title | jsonify }}, + "url": {{ $page.RelPermalink | jsonify }}, + "tags": {{ $page.Params.tags | jsonify }}, + "keywords": {{ $page.Params.keywords | jsonify }}, + "language": {{ $page.Lang | jsonify }} + } + {{- end -}} + ] + \ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html index ceff9a7f1..d7f33f5f5 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -32,6 +32,9 @@ + + + {{ if or (eq .Section "data_types") (eq .Section "research_projects") (eq .Section "funding") (eq .Section "publications") (eq .Section "dashboards") (.Params.datatables) (eq .Section "datasets") }} diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html index 9e5fad935..b38546699 100644 --- a/layouts/partials/navbar.html +++ b/layouts/partials/navbar.html @@ -62,6 +62,11 @@ +
{{ .Params.description }}
++ Start typing to see results... +
+