Skip to content

Commit 075ae52

Browse files
committed
Merge branch 'starlight'
2 parents 065c462 + 043357b commit 075ae52

35 files changed

+6971
-20
lines changed

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.astro
2+
.git
3+
.github
4+
.gitignore
5+
dist
6+
node_modules

.github/workflows/publish.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,39 @@ env:
1111
jobs:
1212
publish:
1313
runs-on: ubuntu-latest
14-
14+
1515
permissions:
1616
contents: read
1717
packages: write
1818
attestations: write
1919
id-token: write
20-
20+
2121
steps:
2222
- uses: actions/checkout@v4
23-
23+
2424
- uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
2525
with:
2626
registry: ${{ env.REGISTRY }}
2727
username: ${{ github.actor }}
2828
password: ${{ secrets.GITHUB_TOKEN }}
29-
29+
3030
- id: meta
3131
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
3232
with:
3333
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3434
tags: |
3535
latest
36-
36+
3737
- id: push
3838
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
3939
with:
4040
context: .
4141
push: true
4242
tags: ${{ steps.meta.outputs.tags }}
4343
labels: ${{ steps.meta.outputs.labels }}
44-
45-
44+
4645
- uses: actions/attest-build-provenance@v2
4746
with:
4847
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
4948
subject-digest: ${{ steps.push.outputs.digest }}
5049
push-to-registry: true
51-

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# build output
2+
dist/
3+
# generated types
4+
.astro/
5+
6+
# dependencies
7+
node_modules/
8+
9+
# logs
10+
npm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
pnpm-debug.log*
14+
15+
16+
# environment variables
17+
.env
18+
.env.production
19+
20+
# macOS-specific files
21+
.DS_Store

.vscode/extensions.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"recommendations": ["astro-build.astro-vscode"],
3+
"unwantedRecommendations": []
4+
}

.vscode/launch.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"command": "./node_modules/.bin/astro dev",
6+
"name": "Development server",
7+
"request": "launch",
8+
"type": "node-terminal"
9+
}
10+
]
11+
}

.vscode/settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"[markdown]": {
3+
"editor.rulers": [80]
4+
},
5+
"[mdx]": {
6+
"editor.rulers": [80]
7+
},
8+
}

Dockerfile

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,35 @@
1-
# https://github.com/lipanski/docker-static-website
2-
FROM lipanski/docker-static-website:2.4.0
1+
# Build environment
2+
FROM debian:bookworm-slim AS build
3+
4+
# mise configuration
5+
ENV MISE_VERSION="v2025.1.9"
6+
ENV MISE_DATA_DIR="/mise"
7+
ENV MISE_CONFIG_DIR="/mise"
8+
ENV MISE_CACHE_DIR="/mise/cache"
9+
ENV MISE_INSTALL_PATH="/usr/local/bin/mise"
10+
ENV PATH="/mise/shims:$PATH"
11+
12+
# pnpm configuration
13+
ENV PNPM_HOME="/pnpm"
14+
ENV PATH="$PNPM_HOME:$PATH"
15+
16+
WORKDIR /app
317

4-
COPY public/* .
18+
# Setup mise
19+
RUN apt-get update && apt-get -y --no-install-recommends install curl ca-certificates
20+
RUN curl https://mise.run | sh
21+
22+
# Use mise to set up local environment tools
23+
COPY mise.toml .
24+
RUN mise trust && mise install
25+
26+
# Primary application build
27+
COPY . .
28+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
29+
RUN pnpm run build
30+
31+
# Runtime static server
32+
# https://github.com/lipanski/docker-static-website
33+
FROM lipanski/docker-static-website:2.4.0 AS runtime
34+
COPY --from=build /app/dist .
35+
EXPOSE 3000

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Starlight Starter Kit: Basics
2+
3+
[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)
4+
5+
```
6+
npm create astro@latest -- --template starlight
7+
```
8+
9+
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/starlight/tree/main/examples/basics)
10+
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/starlight/tree/main/examples/basics)
11+
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/withastro/starlight&create_from_path=examples/basics)
12+
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fwithastro%2Fstarlight%2Ftree%2Fmain%2Fexamples%2Fbasics&project-name=my-starlight-docs&repository-name=my-starlight-docs)
13+
14+
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
15+
16+
## 🚀 Project Structure
17+
18+
Inside of your Astro + Starlight project, you'll see the following folders and files:
19+
20+
```
21+
.
22+
├── public/
23+
├── src/
24+
│ ├── assets/
25+
│ ├── content/
26+
│ │ ├── docs/
27+
│ └── content.config.ts
28+
├── astro.config.mjs
29+
├── package.json
30+
└── tsconfig.json
31+
```
32+
33+
Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name.
34+
35+
Images can be added to `src/assets/` and embedded in Markdown with a relative link.
36+
37+
Static assets, like favicons, can be placed in the `public/` directory.
38+
39+
## 🧞 Commands
40+
41+
All commands are run from the root of the project, from a terminal:
42+
43+
| Command | Action |
44+
| :------------------------ | :----------------------------------------------- |
45+
| `npm install` | Installs dependencies |
46+
| `npm run dev` | Starts local dev server at `localhost:4321` |
47+
| `npm run build` | Build your production site to `./dist/` |
48+
| `npm run preview` | Preview your build locally, before deploying |
49+
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
50+
| `npm run astro -- --help` | Get help using the Astro CLI |
51+
52+
## 👀 Want to learn more?
53+
54+
Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat).

astro.config.mjs

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// @ts-check
2+
import { rehypeHeadingIds } from '@astrojs/markdown-remark';
3+
import starlight from '@astrojs/starlight';
4+
import { defineConfig } from 'astro/config';
5+
import { remarkDefinitionList, defListHastHandlers } from 'remark-definition-list';
6+
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
7+
import rehypeWidont from 'rehype-widont';
8+
import starlightLinksValidator from 'starlight-links-validator';
9+
10+
// https://astro.build/config
11+
export default defineConfig({
12+
integrations: [
13+
starlight({
14+
title: 'xivapi',
15+
favicon: '/favicon.ico',
16+
logo: {
17+
light: './src/assets/logo-light.png',
18+
dark: './src/assets/logo-dark.png',
19+
replacesTitle: true,
20+
},
21+
social: {
22+
discord: 'https://discord.gg/MFFVHWC',
23+
github: 'https://github.com/xivapi',
24+
},
25+
sidebar: [
26+
'docs/welcome',
27+
{
28+
label: 'Guides',
29+
autogenerate: { directory: 'docs/guides' },
30+
},
31+
'docs/software',
32+
{
33+
label: 'API Reference',
34+
link: '/api/1/docs',
35+
attrs: { target: '_blank' },
36+
}
37+
],
38+
components: {
39+
Hero: './src/components/Hero.astro',
40+
MarkdownContent: './src/components/MarkdownContent.astro',
41+
},
42+
customCss: [
43+
'./src/styles/headings.css',
44+
'./src/styles/icons.css',
45+
'./src/styles/theme.css',
46+
],
47+
plugins: [starlightLinksValidator({
48+
exclude: ['/api/1/**']
49+
})],
50+
}),
51+
],
52+
markdown: {
53+
remarkPlugins: [remarkDefinitionList],
54+
rehypePlugins: [
55+
rehypeHeadingIds,
56+
[rehypeAutolinkHeadings, { behavior: 'wrap' }],
57+
rehypeWidont
58+
],
59+
remarkRehype: {
60+
handlers: { ...defListHastHandlers },
61+
},
62+
},
63+
});

compose.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
services:
2+
static:
3+
build: .
4+
init: true
5+
ports:
6+
- "3000:3000"
7+
restart: unless-stopped

mise.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[tools]
2+
node = "22.13.0"
3+
"npm:pnpm" = "10.0.0"

package.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "xivapi",
3+
"type": "module",
4+
"version": "0.0.1",
5+
"scripts": {
6+
"postinstall": "astro telemetry disable",
7+
"dev": "astro dev",
8+
"start": "astro dev",
9+
"build": "astro build",
10+
"preview": "astro preview",
11+
"astro": "astro"
12+
},
13+
"pnpm": {
14+
"onlyBuiltDependencies": [
15+
"sharp"
16+
],
17+
"patchedDependencies": {
18+
"@astrojs/starlight": "patches/@astrojs__starlight.patch"
19+
}
20+
},
21+
"dependencies": {
22+
"@astrojs/markdown-remark": "^6.0.2",
23+
"@astrojs/starlight": "^0.31.0",
24+
"astro": "^5.1.5",
25+
"rehype-autolink-headings": "^7.1.0",
26+
"rehype-widont": "^0.1.1",
27+
"remark-definition-list": "^2.0.0",
28+
"sharp": "^0.32.5",
29+
"starlight-links-validator": "^0.14.1"
30+
}
31+
}

patches/@astrojs__starlight.patch

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
diff --git a/components/SidebarSublist.astro b/components/SidebarSublist.astro
2+
index b521ba13ef57d9be188c8775646f9d361c3d3c7c..dae6eb02b8d0553ad5be0a49961652e41eccef77 100644
3+
--- a/components/SidebarSublist.astro
4+
+++ b/components/SidebarSublist.astro
5+
@@ -24,6 +24,9 @@ const { sublist, nested } = Astro.props;
6+
{...entry.attrs}
7+
>
8+
<span>{entry.label}</span>
9+
+ {('target' in entry.attrs) && entry.attrs.target === '_blank' && (
10+
+ <Icon name="external" class="external-icon"/>
11+
+ )}
12+
{entry.badge && (
13+
<Badge
14+
variant={entry.badge.variant}
15+
@@ -59,6 +62,10 @@ const { sublist, nested } = Astro.props;
16+
</ul>
17+
18+
<style>
19+
+ .external-icon {
20+
+ vertical-align: middle;
21+
+ }
22+
+
23+
ul {
24+
--sl-sidebar-item-padding-inline: 0.5rem;
25+
list-style: none;

0 commit comments

Comments
 (0)