Add a small helper to auto generate internal links from matrix.org links#3396
Open
MTRNord wants to merge 1 commit into
Open
Add a small helper to auto generate internal links from matrix.org links#3396MTRNord wants to merge 1 commit into
MTRNord wants to merge 1 commit into
Conversation
Signed-off-by: MTRNord <MTRNord@users.noreply.github.com>
HarHarLinks
reviewed
May 4, 2026
| @/ prefix, which references content from the content/ directory. It intelligently | ||
| resolves file paths by checking the actual directory structure. | ||
|
|
||
| Usage: |
Contributor
There was a problem hiding this comment.
what's the content_root here?
Member
Author
There was a problem hiding this comment.
Its mostly a convenience feature for when I was testing which allowed me to have some test file in /tmp and then point at the correct content folder of matrix.org. Will update the docs to reflect that :)
HarHarLinks
requested changes
May 4, 2026
| from pathlib import Path | ||
|
|
||
|
|
||
| def find_file_in_content(path_segment: str, content_root: Path) -> str | None: |
Contributor
There was a problem hiding this comment.
this failed to find the right election centre in ee69d53
Was
deliberate or also some bug?
Member
Author
There was a problem hiding this comment.
No that was regex accident before this script was done. This script wasnt in full used on the last twim.
weeman1337
requested changes
May 23, 2026
Contributor
weeman1337
left a comment
There was a problem hiding this comment.
I wold suggest to include a call of zola check to the script after replacing the URLs. Otherwise, just go for it?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Helper which should correctly convert matrix.org absolute urls to the internal zola format on a given file if you run it from the root of the matrix.org repo.
Not a python person so this may be wrong in places? Feel free to nit?
Related issues
Role
Website & Content WG
Timeline
N/A
Signoff
See commits