File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -108,12 +108,17 @@ jobs:
108
108
- name : Remove Tina .gitignore (prevent admin from being ignored)
109
109
run : rm ./build/admin/.gitignore || true
110
110
111
- - name : Move Tina Admin to match baseUrl
111
+ - name : Relocate Tina admin under baseUrl
112
112
run : |
113
- ADMIN_SRC="./build/admin"
114
- ADMIN_DEST="./build${{ secrets.DOCS_BASEURL }}/admin"
115
- mkdir -p "$ADMIN_DEST"
116
- mv "$ADMIN_SRC"/* "$ADMIN_DEST"/
113
+ BASE="${DOCS_BASEURL#/}" # strip leading slash
114
+ BASE="${BASE%/}" # strip trailing slash
115
+ SRC="./build/admin"
116
+ DEST="./build/${BASE}/admin"
117
+ echo "Moving $SRC → $DEST"
118
+ mkdir -p "$DEST"
119
+ mv "$SRC"/* "$DEST"/
120
+ env :
121
+ DOCS_BASEURL : ${{ secrets.DOCS_BASEURL }}
117
122
118
123
- name : Deploy to GitHub Pages
119
124
uses : peaceiris/actions-gh-pages@v3
Original file line number Diff line number Diff line change 1
1
import React , { useEffect } from 'react' ;
2
2
import useBaseUrl from '@docusaurus/useBaseUrl' ;
3
3
4
- export default function AdminRedirect ( ) {
4
+ export default function AdminRedirect ( ) : JSX . Element {
5
+ // resolve to “…/Docusaurus-docs/admin/index.html” in production
5
6
const adminUrl = useBaseUrl ( '/admin/index.html' ) ;
6
7
7
8
useEffect ( ( ) => {
8
- window . location . href = adminUrl ;
9
- } , [ ] ) ;
9
+ window . location . replace ( adminUrl ) ;
10
+ } , [ adminUrl ] ) ;
10
11
11
- return < p > Redirecting to Tina Admin... </ p > ;
12
+ return < p > Redirecting to Tina Admin… </ p > ;
12
13
}
You can’t perform that action at this time.
0 commit comments