feat: Override link text for code blocks#882
Open
KStocky wants to merge 3 commits intoimfing:mainfrom
Open
Conversation
✅ Deploy Preview for hugo-hextra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Owner
|
Thanks for the explanation! The reason I originally preferred the With the current model, I’m not sure how one could easily support cases where the final URL shouldn't include the |
Contributor
Author
|
To be clear, with this approach, I guess that is the negative to this approach. |
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.
This is a proposed fix for #801.
I have made this PR because #820 seems to have been abandoned.
There is a difference in implementation with my PR, though.
Instead of providing another way to specify the URL, this PR proposes to allow writers to override the link text.
Why implement it this way?
By providing a new option called
full_urlyou are giving people another unrelated way of creating URLs that is not compatible with the current way. This may lead to unexpected behaviour (e.g. what should happen if abase_urlandfull_urlare specified?). Additionally, since it would be adding a new way of creating URLs, the logic to implement it is messier.With the
name_overrideway, we are not introducing a new way of specifying URLs. We are instead just allowing people to override the text of the generated URL with another string.With this method the URL will ALWAYS be generated with
base_url+filename.With the change being the link text is
named_override | default filenameI feel like this is a bit cleaner both in terms of expectations from the user, and from an implementation perspective.