|
| 1 | +// @ts-check |
| 2 | +import { defineConfig } from 'astro/config'; |
| 3 | +import starlight from '@astrojs/starlight'; |
| 4 | + |
| 5 | +// Every content page's slug (used to redirect the old Hugo `/docs/...` URLs). |
| 6 | +const slugs = [ |
| 7 | + 'user-guides', |
| 8 | + 'user-guides/faq', |
| 9 | + 'user-guides/getting-started', |
| 10 | + 'user-guides/logging-into-xnat', |
| 11 | + 'user-guides/using-xnat', |
| 12 | + 'user-guides/using-xnat/projects', |
| 13 | + 'user-guides/using-xnat/projects/granting-access', |
| 14 | + 'user-guides/using-xnat/projects/request-storage', |
| 15 | + 'user-guides/using-xnat/subjects', |
| 16 | + 'user-guides/using-xnat/sessions', |
| 17 | + 'user-guides/using-xnat/search', |
| 18 | + 'user-guides/managing-data', |
| 19 | + 'user-guides/managing-data/downloading-data', |
| 20 | + 'user-guides/managing-data/downloading-data/zip-download', |
| 21 | + 'user-guides/managing-data/downloading-data/desktop-client', |
| 22 | + 'user-guides/managing-data/downloading-data/download-scan', |
| 23 | + 'user-guides/managing-data/viewing-images', |
| 24 | + 'user-guides/managing-data/uploading-data', |
| 25 | + 'user-guides/managing-data/uploading-data/web-upload', |
| 26 | + 'user-guides/managing-data/uploading-data/resource-uploader', |
| 27 | + 'user-guides/managing-data/uploading-data/prearchive', |
| 28 | + 'user-guides/managing-data/syncing-data', |
| 29 | + 'user-guides/managing-data/anonymising-data', |
| 30 | + 'user-guides/managing-data/anonymising-data/project-anonymiser', |
| 31 | + 'user-guides/managing-data/anonymising-data/site-anonymiser', |
| 32 | + 'user-guides/processing-data', |
| 33 | + 'user-guides/processing-data/command-line-tools', |
| 34 | + 'user-guides/processing-data/interactive-analysis', |
| 35 | + 'facility-guides', |
| 36 | + 'facility-guides/ctp', |
| 37 | + 'facility-guides/ctp/installation', |
| 38 | + 'facility-guides/ctp/proxy-server', |
| 39 | +]; |
| 40 | + |
| 41 | +// Old Hugo `/docs/<slug>` -> new `/<slug>`, plus the legacy Hugo aliases. |
| 42 | +const redirects = { |
| 43 | + '/docs': '/', |
| 44 | + ...Object.fromEntries(slugs.map((s) => [`/docs/${s}`, `/${s}`])), |
| 45 | + // Getting Started was split into per-member pages; it's now a single tabbed |
| 46 | + // page that selects the member type via a `?member=` query param. Redirect |
| 47 | + // every old per-member URL (both the Astro and original Hugo `/docs/` forms) |
| 48 | + // and the legacy Hugo aliases to the matching tab. |
| 49 | + '/user-guides/getting-started/uq-members': |
| 50 | + '/user-guides/getting-started/?member=uq-members', |
| 51 | + '/user-guides/getting-started/other-aaf-members': |
| 52 | + '/user-guides/getting-started/?member=other-aaf-members', |
| 53 | + '/user-guides/getting-started/non-aaf-members': |
| 54 | + '/user-guides/getting-started/?member=non-aaf-members', |
| 55 | + '/user-guides/getting-started/hirf-users': '/user-guides/getting-started/', |
| 56 | + '/docs/user-guides/getting-started/uq-members': |
| 57 | + '/user-guides/getting-started/?member=uq-members', |
| 58 | + '/docs/user-guides/getting-started/other-aaf-members': |
| 59 | + '/user-guides/getting-started/?member=other-aaf-members', |
| 60 | + '/docs/user-guides/getting-started/non-aaf-members': |
| 61 | + '/user-guides/getting-started/?member=non-aaf-members', |
| 62 | + '/docs/user-guides/getting-started/hirf-users': '/user-guides/getting-started/', |
| 63 | + |
| 64 | + // The standalone "AAF login" page was merged into the Logging into XNAT |
| 65 | + // overview (AAF tab). Alias tokens moved to Processing Data (it's about |
| 66 | + // authenticating external tools, not website login). |
| 67 | + '/user-guides/logging-into-xnat/aaf-login': '/user-guides/logging-into-xnat/', |
| 68 | + '/docs/user-guides/logging-into-xnat/aaf-login': '/user-guides/logging-into-xnat/', |
| 69 | + '/user-guides/logging-into-xnat/alias-tokens': |
| 70 | + '/user-guides/processing-data/alias-tokens', |
| 71 | + '/docs/user-guides/logging-into-xnat/alias-tokens': |
| 72 | + '/user-guides/processing-data/alias-tokens', |
| 73 | + |
| 74 | + // Scans folded into the Sessions overview. |
| 75 | + '/user-guides/using-xnat/sessions/scans': |
| 76 | + '/user-guides/using-xnat/sessions/#viewing-scans', |
| 77 | + '/docs/user-guides/using-xnat/sessions/scans': |
| 78 | + '/user-guides/using-xnat/sessions/#viewing-scans', |
| 79 | + |
| 80 | + // CTP Windows/Linux service pages merged into one OS-tabbed page. |
| 81 | + '/facility-guides/ctp/windows-service': '/facility-guides/ctp/run-as-service', |
| 82 | + '/facility-guides/ctp/linux-service': '/facility-guides/ctp/run-as-service', |
| 83 | + '/docs/facility-guides/ctp/windows-service': '/facility-guides/ctp/run-as-service', |
| 84 | + '/docs/facility-guides/ctp/linux-service': '/facility-guides/ctp/run-as-service', |
| 85 | + |
| 86 | + // Legacy aliases declared in the original Hugo front matter. |
| 87 | + '/docs/user-guides/create-xnat-project': '/user-guides/getting-started', |
| 88 | + '/docs/user-guides/create-xnat-project/create-q-collection-uq-users': |
| 89 | + '/user-guides/getting-started/?member=uq-members', |
| 90 | + '/docs/user-guides/create-xnat-project/create-q-collection-non-uq-users': |
| 91 | + '/user-guides/getting-started/?member=other-aaf-members', |
| 92 | + '/docs/user-guides/browsing-xnat': '/user-guides/using-xnat', |
| 93 | + '/docs/user-guides/login-to-xnat': '/user-guides/logging-into-xnat', |
| 94 | + '/docs/user-guides/login-to-xnat/aaf-login': '/user-guides/logging-into-xnat/', |
| 95 | +}; |
| 96 | + |
| 97 | +// https://astro.build/config |
| 98 | +export default defineConfig({ |
| 99 | + site: 'https://docs.xnat.rcc.uq.edu.au', |
| 100 | + redirects, |
| 101 | + integrations: [ |
| 102 | + starlight({ |
| 103 | + title: 'UQ AIS XNAT', |
| 104 | + description: |
| 105 | + 'Storing, managing and analysing de-identified imaging data for UQ projects and collaborators', |
| 106 | + customCss: ['./src/styles/custom.css'], |
| 107 | + tableOfContents: { minHeadingLevel: 2, maxHeadingLevel: 3 }, |
| 108 | + components: { |
| 109 | + // Replace the header's social-icons slot with our top-nav links. |
| 110 | + SocialIcons: './src/components/NavLinks.astro', |
| 111 | + // Cycling theme toggle (auto → light → dark) instead of the dropdown. |
| 112 | + ThemeSelect: './src/components/ThemeSelect.astro', |
| 113 | + }, |
| 114 | + sidebar: [ |
| 115 | + { |
| 116 | + label: 'User Guides', |
| 117 | + items: [ |
| 118 | + // FAQ hidden from the sidebar until it has real content. |
| 119 | + // The page still exists at /user-guides/faq (kept for old redirects). |
| 120 | + // Getting Started is now a single tabbed page (member type via tabs). |
| 121 | + { label: 'Getting Started', slug: 'user-guides/getting-started' }, |
| 122 | + // Logging into XNAT is now a single page (AAF + RCC Authenticate tabs). |
| 123 | + { label: 'Logging into XNAT', slug: 'user-guides/logging-into-xnat' }, |
| 124 | + { |
| 125 | + label: 'Using XNAT', |
| 126 | + items: [ |
| 127 | + { label: 'Overview', slug: 'user-guides/using-xnat' }, |
| 128 | + { |
| 129 | + label: 'Projects', |
| 130 | + items: [ |
| 131 | + { label: 'Overview', slug: 'user-guides/using-xnat/projects' }, |
| 132 | + { label: 'Granting Access', slug: 'user-guides/using-xnat/projects/granting-access' }, |
| 133 | + { label: 'Request Storage', slug: 'user-guides/using-xnat/projects/request-storage' }, |
| 134 | + ], |
| 135 | + }, |
| 136 | + { label: 'Subjects', slug: 'user-guides/using-xnat/subjects' }, |
| 137 | + { label: 'Sessions', slug: 'user-guides/using-xnat/sessions' }, |
| 138 | + { label: 'Search', slug: 'user-guides/using-xnat/search' }, |
| 139 | + ], |
| 140 | + }, |
| 141 | + { |
| 142 | + label: 'Managing Data', |
| 143 | + items: [ |
| 144 | + { |
| 145 | + label: 'Downloading Data', |
| 146 | + items: [ |
| 147 | + { label: 'Overview', slug: 'user-guides/managing-data/downloading-data' }, |
| 148 | + { label: 'Zip Download', slug: 'user-guides/managing-data/downloading-data/zip-download' }, |
| 149 | + { label: 'Desktop client', slug: 'user-guides/managing-data/downloading-data/desktop-client' }, |
| 150 | + { label: 'Download Scan', slug: 'user-guides/managing-data/downloading-data/download-scan' }, |
| 151 | + ], |
| 152 | + }, |
| 153 | + { label: 'Viewing Images', slug: 'user-guides/managing-data/viewing-images' }, |
| 154 | + { |
| 155 | + label: 'Uploading Data', |
| 156 | + items: [ |
| 157 | + { label: 'Overview', slug: 'user-guides/managing-data/uploading-data' }, |
| 158 | + { label: 'Web Upload', slug: 'user-guides/managing-data/uploading-data/web-upload' }, |
| 159 | + { label: 'Resource uploader', slug: 'user-guides/managing-data/uploading-data/resource-uploader' }, |
| 160 | + { label: 'Prearchive', slug: 'user-guides/managing-data/uploading-data/prearchive' }, |
| 161 | + ], |
| 162 | + }, |
| 163 | + { label: 'Syncing Data', slug: 'user-guides/managing-data/syncing-data' }, |
| 164 | + { |
| 165 | + label: 'Anonymising Data', |
| 166 | + items: [ |
| 167 | + { label: 'Overview', slug: 'user-guides/managing-data/anonymising-data' }, |
| 168 | + { label: 'Project anonymiser', slug: 'user-guides/managing-data/anonymising-data/project-anonymiser' }, |
| 169 | + { label: 'Site anonymiser', slug: 'user-guides/managing-data/anonymising-data/site-anonymiser' }, |
| 170 | + ], |
| 171 | + }, |
| 172 | + ], |
| 173 | + }, |
| 174 | + { |
| 175 | + label: 'Processing Data', |
| 176 | + items: [ |
| 177 | + { label: 'Alias tokens', slug: 'user-guides/processing-data/alias-tokens' }, |
| 178 | + { label: 'Command line tools', slug: 'user-guides/processing-data/command-line-tools' }, |
| 179 | + { label: 'Interactive Analysis', slug: 'user-guides/processing-data/interactive-analysis' }, |
| 180 | + ], |
| 181 | + }, |
| 182 | + ], |
| 183 | + }, |
| 184 | + { |
| 185 | + label: 'Facility Guides', |
| 186 | + items: [ |
| 187 | + { |
| 188 | + label: 'Clinical Trials Processor (CTP)', |
| 189 | + items: [ |
| 190 | + { label: 'Overview', slug: 'facility-guides/ctp' }, |
| 191 | + { label: 'Installation', slug: 'facility-guides/ctp/installation' }, |
| 192 | + { label: 'Run CTP as a service', slug: 'facility-guides/ctp/run-as-service' }, |
| 193 | + { label: 'Proxy Server Settings', slug: 'facility-guides/ctp/proxy-server' }, |
| 194 | + ], |
| 195 | + }, |
| 196 | + ], |
| 197 | + }, |
| 198 | + ], |
| 199 | + }), |
| 200 | + ], |
| 201 | +}); |
0 commit comments