|
26 | 26 | micropy_port = os.getenv('MICROPY_PORT') or 'pyboard' |
27 | 27 | tags.add('port_' + micropy_port) |
28 | 28 | ports = OrderedDict(( |
29 | | - ("unix", "unix"), |
30 | | - ("pyboard", "the pyboard"), |
31 | | - ("wipy", "the WiPy"), |
32 | | - ("esp8266", "esp8266"), |
| 29 | + ('unix', ('unix', 'unix')), |
| 30 | + ('pyboard', ('pyboard', 'the pyboard')), |
| 31 | + ('wipy', ('WiPy', 'the WiPy')), |
| 32 | + ('esp8266', ('ESP8266', 'the ESP8266')), |
33 | 33 | )) |
34 | 34 |
|
35 | 35 | # The members of the html_context dict are available inside topindex.html |
36 | | -url_prefix = os.getenv('MICROPY_URL_PREFIX') or '/' |
| 36 | +micropy_version = os.getenv('MICROPY_VERSION') or 'latest' |
| 37 | +url_pattern = '%s/en/%%s/%%s' % (os.getenv('MICROPY_URL_PREFIX') or '/',) |
37 | 38 | html_context = { |
38 | 39 | 'port':micropy_port, |
39 | | - 'port_name':ports[micropy_port], |
40 | | - 'all_ports':[(n, url_prefix + p) for p, n in ports.items()], |
| 40 | + 'port_short_name':ports[micropy_port][0], |
| 41 | + 'port_name':ports[micropy_port][1], |
| 42 | + 'port_version':micropy_version, |
| 43 | + 'all_ports':[ |
| 44 | + (port_name[0], url_pattern % (micropy_version, port_id)) |
| 45 | + for port_id, port_name in ports.items() |
| 46 | + ], |
| 47 | + 'all_versions':[ |
| 48 | + (ver, url_pattern % (ver, micropy_port)) |
| 49 | + for ver in ('v1.4', 'v1.4.1', 'v1.5', 'v1.6', 'latest') |
| 50 | + ], |
41 | 51 | } |
42 | 52 |
|
43 | 53 |
|
|
0 commit comments