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

enhance(kumascript): make smartLink()'s content parameter optional #9847

Merged
merged 2 commits into from
Nov 29, 2023

Conversation

caugner
Copy link
Contributor

@caugner caugner commented Oct 18, 2023

Summary

Problem

Currently, kumascript's smartLink() requires to pass the link text via the content parameter, but this link text could be automatically derived from the page's short-title or title, like we already do in some sidebar macros (e.g. PWASidebar)

Solution

Make the content parameter optional and use the page's short-title or title, if available.


How did you test this change?

Planning to use this in a follow-up PRs that removes translated page titles from sidebar macros.

Derived by recording the types of all parameters
during a full build of the English locale.
@github-actions github-actions bot added the macros tracking issues related to kumascript macros label Oct 18, 2023
@caugner caugner marked this pull request as ready for review October 19, 2023 16:00
@caugner caugner requested review from wbamberg and a team October 19, 2023 16:00
@caugner
Copy link
Contributor Author

caugner commented Oct 19, 2023

@wbamberg I'm curious to have your opinion on this, but I think this feeds into the path we had agreed on.

@wbamberg
Copy link
Collaborator

@wbamberg I'm curious to have your opinion on this, but I think this feeds into the path we had agreed on.

Yeah, I think this is a good idea. I never really understood exactly what smartLink() though...

Copy link
Member

@LeoMcA LeoMcA left a comment

Choose a reason for hiding this comment

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

lgtm!

@caugner caugner merged commit 3ebd396 into main Nov 29, 2023
13 checks passed
@caugner caugner deleted the make-smartlink-content-param-optional branch November 29, 2023 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macros tracking issues related to kumascript macros
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants