Skip to content

Commit 45b8a1b

Browse files
committed
feat: partial sub-root support
1 parent abf5964 commit 45b8a1b

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.github/workflows/pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Install dependencies
3939
run: npm ci
4040
- name: Build with Astro
41-
run: npm run build
41+
run: BASE_URL='pokeapi.co' npm run build
4242
- name: Upload artifact
4343
uses: actions/upload-pages-artifact@v3
4444
with:

astro.config.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ import starlight from '@astrojs/starlight'
33
import starlightOpenAPI, { openAPISidebarGroups } from 'starlight-openapi'
44
import tailwindcss from '@tailwindcss/vite'
55

6+
const base_url = process.env.BASE_URL || ''
7+
68
export default defineConfig({
79
site: 'https://pokeapi.co',
10+
base: base_url,
811
integrations: [
912
starlight({
1013
title: 'PokéAPI',
@@ -23,7 +26,7 @@ export default defineConfig({
2326
// Generate the OpenAPI documentation pages.
2427
starlightOpenAPI([
2528
{
26-
base: '/v2/openapi',
29+
base: `${base_url}/v2/openapi`,
2730
label: 'OpenAPI',
2831
schema: 'https://raw.githubusercontent.com/PokeAPI/pokeapi/master/openapi.yml',
2932
},

src/content/docs/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ hero:
1010
file: ../../assets/pokeapi_256.png
1111
actions:
1212
- text: Check out the docs!
13-
link: /v2/
13+
link: ./v2/
1414
icon: open-book
1515
variant: primary
1616
- text: View on GitHub
@@ -36,7 +36,7 @@ import { Card, CardGrid } from '@astrojs/starlight/components';
3636
We've covered everything from Pokémon to Berry Flavors.
3737
</Card>
3838
<Card title="Where do I start?" icon="rocket">
39-
We have awesome [documentation](/v2/) on how to use this API. It takes minutes to get started.
39+
We have awesome [documentation](./v2/) on how to use this API. It takes minutes to get started.
4040
<br/>
4141
This API will always be publicly available and will never require any extensive setup process to consume.
4242
</Card>

0 commit comments

Comments
 (0)