-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
Implementation of the Link Decorator function for processing localised links ποΈ #47620
Conversation
β Pull request preview available for checkingBuilt without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
Some clarifications:
|
@tengqm See netlify response above to find build log. UPD. The true functionality of this code can only be assessed after the Hugo is updated to the up-to-date version, see PR #47612. |
/area web-development Nice to see this arrive! |
/unhold |
As PR #47612 has been merged, feel free to review and approve this one as wellπ |
Re-run test to engage new build with updated Hugo |
@Andygol: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
(aside) This repo does not really use Prow's |
π It would be great to re-engage netlify build process somehow to streamline review. |
The only concern from me is about the build time overhead (supposing that all conversions are done during build time). However, as a standalone processor, we can easily disable it if it goes wrong. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tengqm The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Should anyone from sig-docs-website-owners add LGTM? |
Looks like a nice addition to help the localization teams. /lgtm |
LGTM label has been added. Git tree hash: d4effeeaf0186ad7a597d0d48a2120c621b36ea2
|
PRs welcome (from anyone)! But it's not a priority. |
Description
I'm pleased to introduce the Link Decorator feature, which automatically transforms links in localised documents if the referenced documents have been localised. This feature eliminates the need to manually add language codes to links.
This was also inspired by the https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/_default/_markup/render-link.html template, which is already included in Hugo.
The logic is as follows
The current approach fully implements the logic of link decoration by adding a language prefix to localised documents where it is not explicitly specified. Links with a hard-coded https://kubernetes.io/ or https://k8s.io/ are considered external and processed as such, even if there are localised versions of the link in the documentation. Handling such cases significantly complicates the code and processing time, and it is easier to correct such links directly in the text of documents.
I hope that the adoption of this PR will significantly improve the usability of the documentation and simplify the work of translators to maintain it.
Issue
This effort was inspired by a previous discussion about adding language code manually when localising documents.Β β #18403
/hold Depends on: PR #47612 β Fixed flag deprecations and updated Hugo version to latest
/cc @sftim as per your request in Slack.