Skip to content

Commit

Permalink
feat: partial sub-root support
Browse files Browse the repository at this point in the history
  • Loading branch information
Naramsim committed Feb 3, 2025
1 parent abf5964 commit 45b8a1b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Install dependencies
run: npm ci
- name: Build with Astro
run: npm run build
run: BASE_URL='pokeapi.co' npm run build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down
5 changes: 4 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ import starlight from '@astrojs/starlight'
import starlightOpenAPI, { openAPISidebarGroups } from 'starlight-openapi'
import tailwindcss from '@tailwindcss/vite'

const base_url = process.env.BASE_URL || ''

export default defineConfig({
site: 'https://pokeapi.co',
base: base_url,
integrations: [
starlight({
title: 'PokéAPI',
Expand All @@ -23,7 +26,7 @@ export default defineConfig({
// Generate the OpenAPI documentation pages.
starlightOpenAPI([
{
base: '/v2/openapi',
base: `${base_url}/v2/openapi`,
label: 'OpenAPI',
schema: 'https://raw.githubusercontent.com/PokeAPI/pokeapi/master/openapi.yml',
},
Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ hero:
file: ../../assets/pokeapi_256.png
actions:
- text: Check out the docs!
link: /v2/
link: ./v2/
icon: open-book
variant: primary
- text: View on GitHub
Expand All @@ -36,7 +36,7 @@ import { Card, CardGrid } from '@astrojs/starlight/components';
We've covered everything from Pokémon to Berry Flavors.
</Card>
<Card title="Where do I start?" icon="rocket">
We have awesome [documentation](/v2/) on how to use this API. It takes minutes to get started.
We have awesome [documentation](./v2/) on how to use this API. It takes minutes to get started.
<br/>
This API will always be publicly available and will never require any extensive setup process to consume.
</Card>
Expand Down

0 comments on commit 45b8a1b

Please sign in to comment.