File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,16 @@ const prod = process.env.NODE_ENV === "production";
1919export default defineConfig ( {
2020 site : prod ? "https://docs.papermc.io" : undefined ,
2121 integrations : [
22+ // save Markdown renderer configuration to globals for use by the on-demand renderer
23+ // order matters - we want this to use only our configuration
24+ {
25+ name : "docs:config-md" ,
26+ hooks : {
27+ "astro:config:setup" : ( { config } ) => {
28+ globalThis . markdownConfig = { ...config . markdown } ;
29+ } ,
30+ } ,
31+ } ,
2232 starlight ( {
2333 title : "PaperMC Docs" ,
2434 social : [
@@ -394,15 +404,6 @@ export default defineConfig({
394404 pad : 50 ,
395405 skipGeneration : ! prod , // comment out if you have D2 locally and want to use it during dev
396406 } ) ,
397- // save Markdown renderer configuration to globals for use by the on-demand renderer
398- {
399- name : "docs:config-md" ,
400- hooks : {
401- "astro:config:done" : ( { config } ) => {
402- globalThis . markdownConfig = config . markdown ;
403- } ,
404- } ,
405- } ,
406407 ] ,
407408 build : {
408409 inlineStylesheets : "always" ,
Original file line number Diff line number Diff line change @@ -44,9 +44,13 @@ const waterfallProject: Project = await fetch("https://api.papermc.io/v2/project
4444
4545export const LATEST_WATERFALL_RELEASE = waterfallProject . versions [ waterfallProject . versions . length - 1 ] ;
4646
47+ interface Tag {
48+ name : string ;
49+ }
50+
4751const userdevVersions : string [ ] = await fetch ( "https://api.github.com/repos/PaperMC/paperweight/tags" )
48- . then ( ( r ) => r . json ( ) )
49- . then ( ( json ) => json . map ( ( e ) => e . name . substring ( 1 ) ) ) ;
52+ . then ( ( r ) => ( r . ok ? r . json ( ) : [ { name : "v0.0.0" } ] ) )
53+ . then ( ( tags : Tag [ ] ) => tags . map ( ( t ) => t . name . substring ( 1 ) ) ) ;
5054
5155export const LATEST_USERDEV_RELEASE = userdevVersions [ 0 ] ;
5256
You can’t perform that action at this time.
0 commit comments