Charge la clé de recherche via l'environnement
This commit is contained in:
@@ -7,6 +7,12 @@ disableHugoGeneratorInject: true
|
||||
enableEmoji: true
|
||||
timeZone: Europe/Paris
|
||||
theme: ["2026"]
|
||||
security:
|
||||
funcs:
|
||||
getenv:
|
||||
- "^HUGO_"
|
||||
- "^CI$"
|
||||
- "^MEILI_SEARCH_API_KEY$"
|
||||
params:
|
||||
lists:
|
||||
layout: spotlight
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
{{ define "main" }}
|
||||
{{- $search := .Site.Params.search -}}
|
||||
{{- $meili := $search.meilisearch -}}
|
||||
{{- $apiKey := getenv "MEILI_SEARCH_API_KEY" -}}
|
||||
{{- if eq $apiKey "" -}}
|
||||
{{- errorf "MEILI_SEARCH_API_KEY is required to render the search page" -}}
|
||||
{{- end -}}
|
||||
<header class="article-header">
|
||||
{{ partialCached "header-brand.html" .Site .Site.Title (.Site.Params.logo | default "logo-large.png") }}
|
||||
<h1>{{ .Title }}</h1>
|
||||
@@ -9,7 +13,7 @@
|
||||
class="search-page"
|
||||
data-search-endpoint="{{ $meili.endpoint }}"
|
||||
data-search-index="{{ $meili.indexUid }}"
|
||||
data-search-api-key="{{ $meili.apiKey }}"
|
||||
data-search-api-key="{{ $apiKey }}"
|
||||
data-search-limit="{{ $meili.hitsPerPage }}"
|
||||
data-search-param="{{ $search.param }}"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user