File tree Expand file tree Collapse file tree 6 files changed +18
-18
lines changed Expand file tree Collapse file tree 6 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -816,9 +816,10 @@ jobs:
816816 - run :
817817 name : deploy
818818 command : |
819- azcopy copy "/tmp/dist/production/docs/*" "https://reactspectrum.blob.core.windows.net/\$web${AZURE_STORAGE_SAS_TOKEN}" --recursive --exclude-pattern "*.md;*.txt"
820- azcopy copy "/tmp/dist/production/docs/*" "https://reactspectrum.blob.core.windows.net/\$web${AZURE_STORAGE_SAS_TOKEN}" --recursive --include-pattern "*.md" --content-type "text/markdown; charset=utf-8"
821- azcopy copy "/tmp/dist/production/docs/*" "https://reactspectrum.blob.core.windows.net/\$web${AZURE_STORAGE_SAS_TOKEN}" --recursive --include-pattern "*.txt" --content-type "text/plain; charset=utf-8"
819+ azcopy copy "/tmp/dist/production/docs/*" "https://reactspectrum.blob.core.windows.net/\$web${AZURE_STORAGE_SAS_TOKEN}" --recursive --exclude-pattern "*.md;*.txt;*.html;*.rsc"
820+ azcopy copy "/tmp/dist/production/docs/*" "https://reactspectrum.blob.core.windows.net/\$web${AZURE_STORAGE_SAS_TOKEN}" --recursive --include-pattern "*.md" --content-type "text/markdown; charset=utf-8" --cache-control "max-age=300"
821+ azcopy copy "/tmp/dist/production/docs/*" "https://reactspectrum.blob.core.windows.net/\$web${AZURE_STORAGE_SAS_TOKEN}" --recursive --include-pattern "*.txt" --content-type "text/plain; charset=utf-8" --cache-control "max-age=300"
822+ azcopy copy "/tmp/dist/production/docs/*" "https://reactspectrum.blob.core.windows.net/\$web${AZURE_STORAGE_SAS_TOKEN}" --recursive --include-pattern "*.html;*.rsc" --cache-control "max-age=300"
822823
823824 comment :
824825 executor : rsp
Original file line number Diff line number Diff line change @@ -146,16 +146,16 @@ s2-api-diff:
146146 node scripts/api-diff.js --skip-same --skip-style-props
147147
148148s2-docs :
149- BASE_URL =https://reactspectrum.blob.core.windows.net PUBLIC_URL= /reactspectrum/$$(git rev-parse HEAD ) /s2-docs DIST_DIR=dist/$$(git rev-parse HEAD ) /s2-docs $(MAKE ) build-s2-docs
149+ PUBLIC_URL =https://reactspectrum.blob.core.windows.net/reactspectrum/$$(git rev-parse HEAD ) /s2-docs DIST_DIR=dist/$$(git rev-parse HEAD ) /s2-docs $(MAKE ) build-s2-docs
150150
151151s2-docs-production :
152- BASE_URL =https://react-spectrum.adobe.com PUBLIC_URL= /beta DIST_DIR=dist/production/docs/beta $(MAKE ) build-s2-docs
152+ PUBLIC_URL =https://react-spectrum.adobe.com/beta DIST_DIR=dist/production/docs/beta $(MAKE ) build-s2-docs
153153
154154build-s2-docs :
155155 yarn workspace @react-spectrum/s2-docs generate:md
156156 yarn workspace @react-spectrum/s2-docs generate:og
157- REGISTRY_URL=$(BASE_URL )$( PUBLIC_URL ) /registry node scripts/buildRegistry.mjs
158- REGISTRY_URL=$(BASE_URL )$( PUBLIC_URL ) /registry yarn build:s2-docs --public-url $(PUBLIC_URL )
157+ REGISTRY_URL=$(PUBLIC_URL ) /registry node scripts/buildRegistry.mjs
158+ REGISTRY_URL=$(PUBLIC_URL ) /registry yarn build:s2-docs --public-url $(PUBLIC_URL )
159159 mkdir -p $(DIST_DIR )
160160 mv packages/dev/s2-docs/dist/* $(DIST_DIR )
161161 mkdir -p $(DIST_DIR ) /registry
Original file line number Diff line number Diff line change @@ -38,7 +38,8 @@ const dependencies = {
3838 'react-aria-components' : '^1.10.0' ,
3939 react : '^19' ,
4040 'react-dom' : '^19' ,
41- 'lucide-react' : '^0.514.0'
41+ 'lucide-react' : '^0.514.0' ,
42+ 'clsx' : '^2.1.1'
4243 } ,
4344 tailwind : {
4445 'react-aria-components' : '^1.10.0' ,
Original file line number Diff line number Diff line change @@ -64,16 +64,11 @@ const getTitle = (currentPage: Page): string => {
6464} ;
6565
6666const getOgImageUrl = ( currentPage : Page ) : string => {
67- const slug = currentPage . url . replace ( / ^ \/ / , '' ) . replace ( / \. h t m l $ / , '' ) ;
68-
69- if ( slug . includes ( 's2-docs/' ) ) {
70- // For build links, use the full URL
71- const ogPath = slug . replace ( / s 2 - d o c s \/ / , 's2-docs/og/' ) ;
72- return `https://reactspectrum.blob.core.windows.net/${ ogPath } .png` ;
67+ let publicUrl = process . env . PUBLIC_URL || '/' ;
68+ if ( ! publicUrl . endsWith ( '/' ) ) {
69+ publicUrl += '/' ;
7370 }
74-
75- // For production, use relative path with /og/ prefix
76- return `/og/${ slug } .png` ;
71+ return publicUrl + 'og/' + currentPage . url . replace ( publicUrl , '' ) . replace ( / \. h t m l $ / , '.png' ) ;
7772} ;
7873
7974const getDescription = ( currentPage : Page ) : string => {
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export function Nav({pages, currentPage}: PageProps) {
1111 let currentLibrary = getLibraryFromPage ( currentPage ) ;
1212 let sections = new Map ( ) ;
1313 for ( let page of pages ) {
14- if ( page . exports ?. hideNav ) {
14+ if ( page . exports ?. hideNav || page . exports ?. hideFromSearch ) {
1515 continue ;
1616 }
1717
Original file line number Diff line number Diff line change @@ -49,6 +49,8 @@ async function navigate(pathname: string, push = false) {
4949// Intercept link clicks to perform RSC navigation.
5050document . addEventListener ( 'click' , e => {
5151 let link = ( e . target as Element ) . closest ( 'a' ) ;
52+ let publicUrl = process . env . PUBLIC_URL || '/' ;
53+ let publicUrlPathname = publicUrl . startsWith ( 'http' ) ? new URL ( publicUrl ) . pathname : publicUrl ;
5254 if (
5355 link &&
5456 link instanceof HTMLAnchorElement &&
@@ -57,6 +59,7 @@ document.addEventListener('click', e => {
5759 link . origin === location . origin &&
5860 link . pathname !== location . pathname &&
5961 ! link . hasAttribute ( 'download' ) &&
62+ link . pathname . startsWith ( publicUrlPathname ) &&
6063 e . button === 0 && // left clicks only
6164 ! e . metaKey && // open in new tab (mac)
6265 ! e . ctrlKey && // open in new tab (windows)
You can’t perform that action at this time.
0 commit comments