Skip to content

Redirect invalid links in source pages#5

Open
84000-admin wants to merge 1 commit intomasterfrom
dom-source-backlink-fix
Open

Redirect invalid links in source pages#5
84000-admin wants to merge 1 commit intomasterfrom
dom-source-backlink-fix

Conversation

@84000-admin
Copy link
Contributor

@84000-admin 84000-admin commented Mar 10, 2025

A new redirect that handles invalid links back to the translation found at the bottom of the source pages
e.g. https://84000.co/source/toh251/folio/1

Screenshot from 2025-03-10 10-16-23

The redirect works ok, but is a pragmatic fix that could impact other link functionality, most notably expanding translation sections. This should be tested thoroughly.

The change redirects requests to translations based on this regex /translation/:work/:part(UT[\-0-9]+$) so for instance /translation/toh1-1/UT22084-001-001-chapter-1 will pass through to load the chapter but /translation/toh1-1/UT22084-001-001-123 will not.

@vercel
Copy link

vercel bot commented Mar 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
public-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 10, 2025 9:17am

@84000-admin 84000-admin requested a review from Celso-Scott March 10, 2025 09:18
@84000-admin
Copy link
Contributor Author

One approach to testing this would be to look through the data-static repository an try to find chapter files that don't conform to this pattern.

Here we can see that in Toh1-1 they do.
Screenshot from 2025-03-11 09-56-15

Copy link

@Celso-Scott Celso-Scott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @domlatham I looked through all the changes today on the vercel branch and looked through the web display for the texts that I recall have unusual section structures, I didn't find any issues. It looks good to me. To double check I had a script printout all the file names in the data-static/translation directory and looked for anything that would be missed by the regex:

UT[0-9]+-\d+-\d+-\d

html_file_list.txt

It all looks good to me.

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.

3 participants