Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing section anchors & link template #119

Open
mrmagic223325 opened this issue Jul 9, 2024 · 6 comments
Open

Implementing section anchors & link template #119

mrmagic223325 opened this issue Jul 9, 2024 · 6 comments

Comments

@mrmagic223325
Copy link

The Gentoo Wiki uses a specially designed template to allow translating section names while still keeping HTML anchors with the source language name intact. This allows using links of the form https://wiki.nixos.org/wiki/Hydra#Installation in all languages regardless of the actual translation of Installation. The template is described here. Additionally the Gentoo Wiki also implements a special template for linking to translated pages here. This template allows redirecting users to the source language version of a page whenever a translated version does not exist.

@Mic92
Copy link
Member

Mic92 commented Jul 9, 2024

Do you need any special permission to set up templates like this? Otherwise just copy over what you need.

@Mic92
Copy link
Member

Mic92 commented Jul 13, 2024

Is there a way to automate this? As it looks a bit tedious to do this migration by hand.

@Mic92
Copy link
Member

Mic92 commented Jul 13, 2024

@nicolas-goudry do you want to look into this?

@nicolas-goudry
Copy link

I'll take a look at it over the weekend if I have the chance to.

@mrmagic223325
Copy link
Author

Do you need any special permission to set up templates like this? Otherwise just copy over what you need.

I don't know how MediaWiki templates work internally or if there is anything else I'd have to do besides copying them, so I'd prefer not adding them myself.

Is there a way to automate this? As it looks a bit tedious to do this migration by hand.

Doing it by hand wouldn't be too much of a hassle given the wiki is not that big right now (Gentoo's migration is a lot bigger). Searching for all {{}} links inside a page and replacing them with the template is pretty simple. Adding anchors to every section is slightly more tedious but still pretty manageable. (Source: I've been part of the migration on the Gentoo Wiki and usually would translate pages and migrate the source pages whenever I encountered an old link or section in the process)

@nicolas-goudry
Copy link

@mrmagic223325 Would you happen to be at NixCon by any chance? I don’t really know mediawiki bits and pieces so it would be great to speak in person!

If not, is there somewhere I could reach out to you directly? Matrix or discourse maybe?

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

No branches or pull requests

3 participants