|
7 | 7 | workflow_dispatch: |
8 | 8 | inputs: |
9 | 9 | versions: |
10 | | - description: "Specific versions to generate (comma-separated, e.g. '1.148.1,1.120.25'). Leave empty for auto-detect from maintenance versions." |
| 10 | + description: "Comma-separated versions. Use @sapui5/types@1.149.0 for SAPUI5, bare 1.149.0 defaults to OpenUI5. Leave empty for auto-detect." |
11 | 11 | required: false |
12 | 12 | default: "" |
13 | 13 |
|
@@ -151,6 +151,74 @@ jobs: |
151 | 151 | echo "All versions up to date — nothing to generate" |
152 | 152 | fi |
153 | 153 |
|
| 154 | + - name: Update index pages |
| 155 | + working-directory: gh-pages |
| 156 | + run: | |
| 157 | + BASE="https://ui5.github.io/typescript/api" |
| 158 | +
|
| 159 | + # Start building api/index.html |
| 160 | + cat > api/index.html << 'EOF' |
| 161 | + <!DOCTYPE html> |
| 162 | + <html lang="en"><head> |
| 163 | + <meta charset="utf-8"> |
| 164 | + <title>UI5 TypeScript API Reference</title> |
| 165 | + <meta name="description" content="Crawlable TypeScript API documentation for OpenUI5 and SAPUI5"> |
| 166 | + <meta name="viewport" content="width=device-width,initial-scale=1"> |
| 167 | + <link rel="canonical" href="https://ui5.github.io/typescript/api/"> |
| 168 | + <style>body{font-family:system-ui,-apple-system,sans-serif;max-width:56em;margin:0 auto;padding:2em;line-height:1.6;color:#1a1a2e}a{color:#0366d6;text-decoration:none}a:hover{text-decoration:underline}h1{border-bottom:2px solid #e1e4e8;padding-bottom:0.3em}h2{margin-top:2em}table{border-collapse:collapse;width:100%}th,td{text-align:left;padding:0.5em 1em;border-bottom:1px solid #e1e4e8}th{background:#f6f8fa}nav{font-size:0.9em;margin-bottom:1.5em}</style> |
| 169 | + </head><body> |
| 170 | + <nav><a href="../">← UI5 & TypeScript</a></nav> |
| 171 | + <h1>UI5 TypeScript API Reference</h1> |
| 172 | + <p>Generated from <code>@openui5/types</code> and <code>@sapui5/types</code> type definitions.</p> |
| 173 | + EOF |
| 174 | +
|
| 175 | + for FRAMEWORK in openui5 sapui5; do |
| 176 | + [ -d "api/${FRAMEWORK}" ] || continue |
| 177 | + TITLE=$( [[ "$FRAMEWORK" == "openui5" ]] && echo "OpenUI5" || echo "SAPUI5" ) |
| 178 | + PKG=$( [[ "$FRAMEWORK" == "openui5" ]] && echo "@openui5/types" || echo "@sapui5/types" ) |
| 179 | +
|
| 180 | + # Collect versions (directories containing a .version file), sorted newest first |
| 181 | + ROWS_MAIN="" |
| 182 | + ROWS_FW="" |
| 183 | + for VDIR in $(find "api/${FRAMEWORK}" -maxdepth 1 -mindepth 1 -type d | sort -t. -k2 -rn); do |
| 184 | + DIR_NAME=$(basename "$VDIR") |
| 185 | + if [ -f "${VDIR}/.version" ]; then |
| 186 | + FULL_VER=$(cat "${VDIR}/.version") |
| 187 | + ROWS_MAIN="${ROWS_MAIN}<tr><td><a href=\"${FRAMEWORK}/${DIR_NAME}/index.html\">${FULL_VER}</a></td><td>${DIR_NAME}</td></tr>" |
| 188 | + ROWS_FW="${ROWS_FW}<tr><td><a href=\"${DIR_NAME}/index.html\">${FULL_VER}</a></td><td>${DIR_NAME}</td></tr>" |
| 189 | + fi |
| 190 | + done |
| 191 | +
|
| 192 | + [ -z "$ROWS_MAIN" ] && continue |
| 193 | +
|
| 194 | + # Append framework section to main index |
| 195 | + cat >> api/index.html << EOF |
| 196 | + <h2>${TITLE}</h2> |
| 197 | + <p>Package: <code>${PKG}</code></p> |
| 198 | + <table><thead><tr><th>Version</th><th>Minor</th></tr></thead><tbody>${ROWS_MAIN}</tbody></table> |
| 199 | + EOF |
| 200 | +
|
| 201 | + # Create framework-specific index |
| 202 | + cat > "api/${FRAMEWORK}/index.html" << EOF |
| 203 | + <!DOCTYPE html> |
| 204 | + <html lang="en"><head> |
| 205 | + <meta charset="utf-8"> |
| 206 | + <title>${TITLE} TypeScript API — Versions</title> |
| 207 | + <meta name="viewport" content="width=device-width,initial-scale=1"> |
| 208 | + <link rel="canonical" href="${BASE}/${FRAMEWORK}/"> |
| 209 | + <style>body{font-family:system-ui,-apple-system,sans-serif;max-width:56em;margin:0 auto;padding:2em;line-height:1.6;color:#1a1a2e}a{color:#0366d6;text-decoration:none}a:hover{text-decoration:underline}h1{border-bottom:2px solid #e1e4e8;padding-bottom:0.3em}table{border-collapse:collapse;width:100%}th,td{text-align:left;padding:0.5em 1em;border-bottom:1px solid #e1e4e8}th{background:#f6f8fa}nav{font-size:0.9em;margin-bottom:1.5em}</style> |
| 210 | + </head><body> |
| 211 | + <nav><a href="../">← All Frameworks</a></nav> |
| 212 | + <h1>${TITLE} TypeScript API</h1> |
| 213 | + <p>Package: <code>${PKG}</code></p> |
| 214 | + <table><thead><tr><th>Version</th><th>Minor</th></tr></thead><tbody>${ROWS_FW}</tbody></table> |
| 215 | + </body></html> |
| 216 | + EOF |
| 217 | + done |
| 218 | +
|
| 219 | + # Close main index |
| 220 | + echo "</body></html>" >> api/index.html |
| 221 | +
|
154 | 222 | - name: Commit and push to gh-pages |
155 | 223 | working-directory: gh-pages |
156 | 224 | run: | |
|
0 commit comments