Skip to content

Commit

Permalink
fix(docs): use Link for search results
Browse files Browse the repository at this point in the history
  • Loading branch information
wmertens committed Jul 18, 2024
1 parent 517719b commit 1d79edb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions packages/docs/src/components/docsearch/result.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { SearchContext } from './context';
import { AiResultOpenContext, type DocSearchState } from './doc-search';
import { Snippet } from './snippet';
import type { InternalDocSearchHit } from './types';
import { Link } from '@builder.io/qwik-city';

export const Result = component$(
({ state, item }: { state: DocSearchState; item: InternalDocSearchHit }) => {
Expand Down Expand Up @@ -49,7 +50,9 @@ export const Result = component$(
.filter(Boolean)
.join(' ')}
>
<a href={item.url}>
<Link
href={item.url.replace('https://qwik.dev/', '/').replace('https://qwik.builder.io/', '/')}
>
<div class="DocSearch-Hit-Container">
<Slot name="start-action"></Slot>
{/* @ts-ignore */}
Expand Down Expand Up @@ -98,7 +101,7 @@ export const Result = component$(
)}
<Slot name="end-action"></Slot>
</div>
</a>
</Link>
</li>
);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/src/routes/docs/(qwikcity)/routing/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ Qwik City also supports:
- [Request Handling](/docs/(qwikcity)/advanced/request-handling/index.mdx)

## Typesafe Routing
- [Typed Routes](/docs/(qwikcity)/labs/typed-routes/index.mdx#-typed-routes)
- [Declarative Routing](/docs/(qwikcity)/labs/typed-routes/index.mdx#declarative-routing)
- [Typed Routes](/docs/labs/typed-routes/index.mdx#-typed-routes)
- [Declarative Routing](/docs/labs/typed-routes/index.mdx#declarative-routing)

These are discussed later.

0 comments on commit 1d79edb

Please sign in to comment.