diff options
| author | Rafael Laboissière <rafael@laboissiere.net> | 2025-06-25 14:02:46 -0300 |
|---|---|---|
| committer | Rafael Laboissière <rafael@laboissiere.net> | 2025-06-25 14:02:46 -0300 |
| commit | 47845de8ee2e1fcd75828f6269d1b596f43e2de9 (patch) | |
| tree | 569708594b7bb1bf61e39e865c8fa04b1ecf1d2e /www/index.html.in | |
| parent | 84b508918ed63f0ce90cb19aafa8b218744a5365 (diff) | |
Get versions automatically
Diffstat (limited to 'www/index.html.in')
| -rw-r--r-- | www/index.html.in | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/www/index.html.in b/www/index.html.in index 08d4041..d9dea48 100644 --- a/www/index.html.in +++ b/www/index.html.in @@ -58,10 +58,39 @@ pre { distribution, for recent upstream versions and for the amd64 and i386 architectures.</p> - <p>You can check the available versions for - the <a href="dists/bookworm/main/binary-amd64/Packages">amd64</a> and - the <a href="dists/bookworm/main/binary-i386/Packages">i386</a> - architectures.</p> + <p>Available versions:</p> + + <table> + <tr> + <td>amd64:</td><td><span id="amd64"></span></td> + </tr> + <tr> + <td>i386:</td><td><span id="i386"></span></td> + </tr> + </table> + + <script> + function get_version(arch) { + return fetch('dists/bookworm/main/binary-' + arch + '/Packages') + .then(response => { + return response.text(); + }) + .then(content => { + const lines = content.split('\n'); + for (const line of lines) { + const fields = line.split(':'); + if (fields[0] == 'Version') { + console.log(fields[1]); + document.getElementById(arch).textContent =fields[1]; + } + } + }); + } + + get_version('amd64'); + get_version('i386'); + + </script> <p>For installing the package, run the following command:</p> |
