mirror of
https://github.com/alexohneander/alexohneander-astro.git
synced 2025-12-11 01:48:08 +00:00
feat: initial commit
This commit is contained in:
27
src/pages/search.astro
Normal file
27
src/pages/search.astro
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
import { getCollection } from "astro:content";
|
||||
import { SITE } from "@config";
|
||||
import Layout from "@layouts/Layout.astro";
|
||||
import Main from "@layouts/Main.astro";
|
||||
import Header from "@components/Header.astro";
|
||||
import Footer from "@components/Footer.astro";
|
||||
import Search from "@components/Search";
|
||||
|
||||
// Retrieve all articles
|
||||
const posts = await getCollection("blog", ({ data }) => !data.draft);
|
||||
|
||||
// List of items to search in
|
||||
const searchList = posts.map(({ data }) => ({
|
||||
title: data.title,
|
||||
description: data.description,
|
||||
data,
|
||||
}));
|
||||
---
|
||||
|
||||
<Layout title={`Search | ${SITE.title}`}>
|
||||
<Header activeNav="search" />
|
||||
<Main pageTitle="Search" pageDesc="Search any article ...">
|
||||
<Search client:load searchList={searchList} />
|
||||
</Main>
|
||||
<Footer />
|
||||
</Layout>
|
||||
Reference in New Issue
Block a user