File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ const path = require("path");
1111const fs = require ( "fs" ) ;
1212const macros = require ( "./src/katex-macros.js" ) ;
1313const versions = require ( "./versions.json" ) ;
14+ const nightlyVersion = versions . find ( ( v ) => v . includes ( "nightly" ) ) ;
1415
1516// To redirect /api to the static/api directory in dev mode (netlify handles it in prod)
1617function apiPlugin ( context : any , options : any ) {
@@ -90,11 +91,15 @@ const config: Config = {
9091 includeCurrentVersion : process . env . ENV === "dev" ,
9192 // There should be 2 versions, nightly and stable
9293 // The stable version is second in the list
93- lastVersion : versions [ 1 ] ,
94+ // Fall back to versions[0] if only one version exists (e.g., during release builds)
95+ lastVersion : versions [ 1 ] ?? versions [ 0 ] ,
9496 versions : {
95- [ versions [ 0 ] ] : {
96- ...( versions [ 0 ] . includes ( "nightly" ) && { path : "nightly" } ) ,
97- } ,
97+ ...( nightlyVersion && versions [ 1 ] && {
98+ [ nightlyVersion ] : {
99+ path : "nightly" ,
100+ banner : "unreleased" ,
101+ } ,
102+ } ) ,
98103 ...( process . env . ENV === "dev" && {
99104 current : {
100105 label : "dev" ,
You can’t perform that action at this time.
0 commit comments