Skip to content

Commit 64c3cb7

Browse files
feat(lapis2-docs): configure base to handle links behind reverse proxy
1 parent 2ede4aa commit 64c3cb7

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

lapis2-docs/astro.config.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ export default defineConfig({
9494
entrypoint: 'astro/assets/services/sharp',
9595
},
9696
},
97+
base: process.env.BASE_URL,
98+
site: process.env.ASTRO_SITE,
9799
});
98100

99101
/**
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
interface Props {
3+
href: string;
4+
}
5+
6+
const { href } = Astro.props;
7+
const base = (import.meta.env.BASE_URL || '').replace(/\/$/, '');
8+
---
9+
10+
<a href={base + href}>
11+
<slot />
12+
</a>

lapis2-docs/src/components/FiltersTable.astro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
import { getConfig, Metadata } from '../config';
3+
import BaseAwareLink from './BaseAwareLink.astro';
34
45
const config = getConfig();
56
const filters: Metadata[] = [];
@@ -32,7 +33,8 @@ for (let meta of config.schema.metadata) {
3233
<td>
3334
{f.type === 'pango_lineage' ? (
3435
<>
35-
See <a href='/concepts/pango-lineage-query/'>Pango lineage query</a>
36+
See
37+
<BaseAwareLink href='/concepts/pango-lineage-query/'>Pango lineage query</BaseAwareLink>
3638
</>
3739
) : (
3840
<i>TODO</i>

lapis2-docs/src/content/docs/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ hero:
66
tagline: Instance for SARS-CoV-2
77
actions:
88
- text: Introduction
9-
link: /getting-started/introduction
9+
link: getting-started/introduction/
1010
icon: right-arrow
1111
variant: primary
1212
- text: LAPIS on GitHub

0 commit comments

Comments
 (0)