Skip to content

Prerender static pages in post_deploy hook#447

Open
nykula wants to merge 2 commits into
LMMS:masterfrom
nykula:master
Open

Prerender static pages in post_deploy hook#447
nykula wants to merge 2 commits into
LMMS:masterfrom
nykula:master

Conversation

@nykula
Copy link
Copy Markdown

@nykula nykula commented May 21, 2026

Re: #417, #423

Introduce an app:prerender command that renders home page, Download, News, Get Involved, Showcase, Competitions, Branding and Wiki to static pages in public/. Call it from hooks/post_deploy - is this how the website gets updated in production? You can also call it in cron.

Major difference: trailing slashes, because it's easiest to get working. Where there was /download, now there is /download/. The web server should redirect to a trailing slash automatically when it sees a directory.

Change e.g. /download/artifact/... to /download-artifact/... so that the /download/ static page doesn't prevent nightly downloads from working. Well, they still don't work while the backend is down due to high load, but I get 403 errors from GitHub API when trying to generate multiple download URLs in a row for static pages, so leaving this as is for now.

Add an http-equiv redirect under /documentation/. Not a good way to make a redirect, but better than a 502 error.

Note: I think one will need to change web server config so that the HTML is cached at most for a day.

Would these changes be okay?

@nykula
Copy link
Copy Markdown
Author

nykula commented May 22, 2026

Added code that applies translations client-side. It relies on the following being run somewhere on server (if not run, nothing breaks, the website just remains in English):

tx pull -a --minimum-perc 85 --json
mv translations/*json public/translations/

For tx pull, an environment variable TX_TOKEN needs to be set to a token generated in Transifex. The token gives access to the Transifex account API so should be carefully kept as a backend secret.

@headquarter8302 headquarter8302 linked an issue May 22, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make non-dynamic pages static

1 participant