(articleRoot)
| 517 | } |
| 518 | |
| 519 | function getArticleIndex(articleRoot) { |
| 520 | articleRoot = articleRoot || 'ai-articles'; |
| 521 | |
| 522 | if (articleIndexCache[articleRoot]) { |
| 523 | return articleIndexCache[articleRoot]; |
| 524 | } |
| 525 | |
| 526 | articleIndexCache[articleRoot] = fetch(articleRoot + '/README.md?v=20260604-bilingual-readme', { |
| 527 | cache: 'force-cache' |
| 528 | }) |
| 529 | .then(function (response) { |
| 530 | if (!response.ok) { |
| 531 | return ''; |
| 532 | } |
| 533 | |
| 534 | return response.text(); |
| 535 | }) |
| 536 | .then(function (markdown) { |
| 537 | return extractArticleIndex(markdown, articleRoot); |
| 538 | }) |
| 539 | .catch(function () { |
| 540 | return []; |
| 541 | }); |
| 542 | |
| 543 | return articleIndexCache[articleRoot]; |
| 544 | } |
| 545 | |
| 546 | function extractArticleIndex(markdown, articleRoot) { |
| 547 | var articles = []; |
no test coverage detected