瀏覽代碼

fix(i18n): fix Hero widget and search for multilingual sites

Fix #820
Paulo Moreno 6 年之前
父節點
當前提交
11c1ebe955
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      layouts/partials/footer.html
  2. 1 1
      layouts/partials/widgets/hero.html

+ 1 - 1
layouts/partials/footer.html

@@ -55,7 +55,7 @@
     {{ if ne .Site.Params.search.engine 0 }}
     {{/* Configure search engine. */}}
     <script>
-      const search_index_filename = {{ "/index.json" | relURL }};
+      const search_index_filename = {{ "/index.json" | relLangURL }};
       const i18n = {
         'placeholder': {{ i18n "search_placeholder" }},
         'results': {{ i18n "search_results" }},

+ 1 - 1
layouts/partials/widgets/hero.html

@@ -5,7 +5,7 @@
 {{/* Compute image path outside of HTML style element due to Hugo limitation. */}}
 {{ $overlay_img := "" }}
 {{ if $header.overlay_img }}
-  {{ $overlay_img = (printf "img/%s" $header.overlay_img) }}
+  {{ $overlay_img = (printf "img/%s" $header.overlay_img) | relURL }}
 {{end}}
 
 <section id="{{ $page.File.TranslationBaseName }}" class="hero-overlay" style="