diff options
author | Martin Fischer <martin@push-f.com> | 2021-11-27 12:06:22 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-11-27 12:54:12 +0100 |
commit | a650e9718e7d3e259324dd4a91a0c47061ef945f (patch) | |
tree | 5c8c5c54f68f965aab741cda6c7061c77ac11e79 | |
parent | bed05ffbbb2a6802fd358a353dd44fc2e5ad251c (diff) |
html: link release notes
-rwxr-xr-x | build.py | 8 | ||||
-rw-r--r-- | script.js | 4 | ||||
-rw-r--r-- | style.css | 10 |
3 files changed, 21 insertions, 1 deletions
@@ -118,7 +118,8 @@ with open('target/index.html', 'w') as f: after_beta = False for version, data in versions.items(): - f.write('<h2 id={0}>{0}'.format(version)) + f.write('<div id={0} class=release>'.format(version)) + f.write('<h2>{}'.format(version)) channel = data.get('channel') if after_beta: channel = 'stable' @@ -130,6 +131,11 @@ with open('target/index.html', 'w') as f: after_beta = True f.write(' [{}]'.format(channel)) f.write('</h2>') + + if 'blog_post_path' in data: + f.write('<a class=release-notes href="https://blog.rust-lang.org/{}">{}</a>'.format(data['blog_post_path'], 'release notes')) + f.write('</div>') + if 'features' in data: write_features(f, version, data['features']) @@ -23,6 +23,10 @@ return false; } ); + + // so that release notes don't get in the way when <Tab>ing through results + document.body.classList.toggle('hide-release-notes', results.length == 0); + const ul = document.createElement('ul'); for (const feat of results) { const li = document.createElement('li'); @@ -28,3 +28,13 @@ h1 { margin-top: 0; margin-bottom: 0; } + +.release:not([hidden]) { + display: flex; + align-items: center; + gap: 1em; +} + +.hide-release-notes .release-notes { + display: none; +} |