From 8aeb562bb33aa040ba9318aa1b3aefb58045abad Mon Sep 17 00:00:00 2001
From: Jimmy Cai <jimmehcai@gmail.com>
Date: Sun, 4 Oct 2020 15:45:23 +0200
Subject: [PATCH] feat(search): preload search.json

---
 layouts/page/search.html | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/layouts/page/search.html b/layouts/page/search.html
index 6c98cc5..618f586 100644
--- a/layouts/page/search.html
+++ b/layouts/page/search.html
@@ -1,4 +1,9 @@
 {{ define "body-class" }}template-search{{ end }}
+{{ define "head" }}
+    {{- with .OutputFormats.Get "json" -}} 
+        <link rel="preload" href="{{ .Permalink }}" as="fetch" crossorigin="anonymous">
+    {{- end -}}
+{{ end }}
 {{ define "main" }}
 <form action="{{ .Permalink }}" class="search-form"{{ with .OutputFormats.Get "json" -}} data-json="{{ .Permalink }}"{{- end }}>
     <p>