Skip to content

Commit 95fb3e9

Browse files
authored
Upgrade to Astro 6 (#538)
1 parent e8e8a5f commit 95fb3e9

File tree

19 files changed

+2069
-1309
lines changed

19 files changed

+2069
-1309
lines changed

astro.config.mjs

Lines changed: 92 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// @ts-check
2-
import { defineConfig, envField } from 'astro/config';
2+
import { defineConfig, envField, fontProviders } from 'astro/config';
33
import starlight from '@astrojs/starlight';
44
import starlightUtils from '@lorenzo_lewis/starlight-utils';
55
import starlightDocSearch from '@astrojs/starlight-docsearch';
@@ -25,9 +25,97 @@ const response = await fetch(
2525
const data = await response.json();
2626
const latestVersion = data.tag_name.replace('v', '');
2727

28+
const aeonikProVariants = [
29+
{
30+
src: [
31+
'./src/fonts/AeonikPro/AeonikPro-Regular.woff2',
32+
'./src/fonts/AeonikPro/AeonikPro-Regular.woff',
33+
],
34+
weight: 400,
35+
style: 'normal',
36+
},
37+
{
38+
src: [
39+
'./src/fonts/AeonikPro/AeonikPro-RegularItalic.woff2',
40+
'./src/fonts/AeonikPro/AeonikPro-RegularItalic.woff',
41+
],
42+
weight: 400,
43+
style: 'italic',
44+
},
45+
{
46+
src: [
47+
'./src/fonts/AeonikPro/AeonikPro-Medium.woff2',
48+
'./src/fonts/AeonikPro/AeonikPro-Medium.woff',
49+
],
50+
weight: 500,
51+
style: 'normal',
52+
},
53+
{
54+
src: [
55+
'./src/fonts/AeonikPro/AeonikPro-MediumItalic.woff2',
56+
'./src/fonts/AeonikPro/AeonikPro-MediumItalic.woff',
57+
],
58+
weight: 500,
59+
style: 'italic',
60+
},
61+
];
62+
2863
// https://astro.build/config
2964
export default defineConfig({
3065
site: 'https://docs.localstack.cloud',
66+
fonts: [
67+
{
68+
provider: fontProviders.local(),
69+
name: 'Aeonik Pro',
70+
cssVariable: '--font-aeonik-pro',
71+
fallbacks: ['sans-serif'],
72+
options: { variants: aeonikProVariants },
73+
},
74+
{
75+
provider: fontProviders.local(),
76+
name: 'Aeonik Fono',
77+
cssVariable: '--font-aeonik-fono',
78+
fallbacks: ['sans-serif'],
79+
options: {
80+
variants: [
81+
{
82+
src: [
83+
'./src/fonts/AeonikFono/aeonikfonopro-regular.woff2',
84+
'./src/fonts/AeonikFono/aeonikfonopro-regular.woff',
85+
],
86+
weight: 400,
87+
style: 'normal',
88+
},
89+
{
90+
src: [
91+
'./src/fonts/AeonikFono/aeonikfonopro-medium.woff2',
92+
'./src/fonts/AeonikFono/aeonikfonopro-medium.woff',
93+
],
94+
weight: 500,
95+
style: 'normal',
96+
},
97+
],
98+
},
99+
},
100+
{
101+
provider: fontProviders.local(),
102+
name: 'Aeonik Mono',
103+
cssVariable: '--font-aeonik-mono',
104+
fallbacks: ['ui-monospace', 'monospace'],
105+
options: {
106+
variants: [
107+
{
108+
src: [
109+
'./src/fonts/AeonikMono/AeonikMono-Regular.woff2',
110+
'./src/fonts/AeonikMono/AeonikMono-Regular.woff',
111+
],
112+
weight: 400,
113+
style: 'normal',
114+
},
115+
],
116+
},
117+
},
118+
],
31119
env: {
32120
schema: {
33121
LOCALSTACK_VERSION: envField.string({
@@ -44,15 +132,12 @@ export default defineConfig({
44132
title: 'Docs',
45133
favicon: '/images/favicons/favicon.ico',
46134
routeMiddleware: './src/routeData.ts',
47-
customCss: [
48-
'./src/fonts/font-face.css',
49-
'./src/styles/global.css',
50-
'./src/styles/custom.css',
51-
],
135+
customCss: ['./src/styles/global.css', './src/styles/custom.css'],
52136
editLink: {
53137
baseUrl: 'https://github.com/localstack/localstack-docs/edit/main/',
54138
},
55139
components: {
140+
Head: './src/components/StarlightHead.astro',
56141
PageTitle: './src/components/PageTitleWithCopyButton.astro',
57142
PageSidebar: './src/components/PageSidebarWithBadges.astro',
58143
LanguageSelect: './src/components/LanguageSelectWithGetStarted.astro',
@@ -62,7 +147,7 @@ export default defineConfig({
62147
expressiveCode: {
63148
themes: ['one-light', 'one-dark-pro'],
64149
styleOverrides: {
65-
codeFontFamily: 'AeonikMono, ui-monospace',
150+
codeFontFamily: 'var(--font-aeonik-mono), ui-monospace',
66151
borderRadius: '0.5rem',
67152
},
68153
},

0 commit comments

Comments
 (0)