Skip to content

Commit

Permalink
Merge pull request #10 from impaktor/fix-issue-urls
Browse files Browse the repository at this point in the history
Make links to github issues clickable in release notes & disable stale code
  • Loading branch information
impaktor authored Jul 12, 2024
2 parents 3ac3d1d + 66e6be9 commit c9ad72f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
test: downloadlinks changelog releasejs
test: downloadlinks
hugo server -w --logLevel info --bind 0.0.0.0
release: downloadlinks changelog releasejs
release: downloadlinks
hugo
deploy: release
rsync --chown www-data:www-data -avz --delete --exclude 'forum/' --exclude 'codedoc/' docs/ pioneer:/var/www/pioneerspacesim.net/
downloadlinks:
python3 make-downloadlinks.py > layouts/partials/generated/downloadlinks.html

# Unused
changelog:
python3 make-changelog.py > layouts/partials/generated/changelog.html
releasejs:
Expand Down
2 changes: 1 addition & 1 deletion content/page/download.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ See the [compiling guide](https://github.com/pioneerspacesim/pioneer/blob/master

## Changelog

{{< changelog >}}
For list of full development history, see [Changelog.txt](https://github.com/pioneerspacesim/pioneer/blob/master/Changelog.txt)
5 changes: 5 additions & 0 deletions make-changelog.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""
Generate changelog for latest month.
"""

#!/usr/bin/python
import collections
import re
Expand All @@ -7,6 +11,7 @@
changelog = urllib.request.urlopen('https://raw.githubusercontent.com/pioneerspacesim/pioneer/master/Changelog.txt').read().decode('utf-8')
for line in changelog.splitlines():
if firstline:
# Get title: "Month YYYY"
lines.append((0, line.strip()))
firstline = False
elif len(line) == 0:
Expand Down
8 changes: 7 additions & 1 deletion make-downloadlinks.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
#!/usr/bin/python
import json
import re
import urllib.request

import markdown

with urllib.request.urlopen('https://api.github.com/repos/pioneerspacesim/pioneer/releases/latest') as json_file:
latest = json.load(json_file)
assets = latest['assets']
title = latest['name']
body = markdown.markdown(latest['body'])

# Make issue tags "(#<numbers>)" clickable
body = re.sub(r'#(\d+)', r'<a href="https://github.com/pioneerspacesim/pioneer/issues/\1">#\1</a>', body.strip().lstrip(' *'))

print(f'<h4>Release: {title}</h4>')
print('<ul>')
for asset in assets:
Expand All @@ -23,4 +30,3 @@
print(f'<li><a data-umami-event="Downloaded {date} ({label})" href="{url}">{name}</a> ({date} · {size} MB)</li>')
print('</ul>')
print(f'<p>{body}</p>')

3 changes: 3 additions & 0 deletions make-release-js.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
elif "linux" in name:
tag = "Lin64"
name = "Linux 64"
elif "App" in name:
tag = "App"
name = "App Image Linux 64"
else:
tag = "Unk"
name = "Unknown"
Expand Down

0 comments on commit c9ad72f

Please sign in to comment.