feat: add search functionality

Refs: #25
This commit is contained in:
Oliver Davies 2022-10-19 21:52:04 +01:00
parent 7ee59c28df
commit 362f2335ec
2 changed files with 11 additions and 13 deletions

View file

@ -31,6 +31,10 @@ const footerLinks = [
title: 'Daily list',
href: '/daily',
},
{
title: 'Search',
href: '/search',
},
]
---

View file

@ -1,17 +1,11 @@
---
import PageLayout from '../layouts/PageLayout.astro'
---
<script>
import Alpine from 'alpinejs';
window.Alpine = Alpine;
Alpine.start();
</script>
<div x-data="{ term: '' }">
<form :action="`https://www.google.com/search?q=site%3Aoliverdavies.uk+%22` + term + `%22`">
<input type="text" x-model="term" />
<button>Search</button>
<PageLayout title="Search">
<form action="https://www.google.com/search" method="get">
<input type="hidden" name="q" value="site:https://www.oliverdavies.uk">
<input type="text" name="q" alt="search">
<input type="submit" value="Search">
</form>
</div>
</PageLayout>