-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
Need Method to Specify URLs in Content Pages #4804
Comments
If #4728 were resolved, and either the |
If
I'm assuming, of course, that embedding one shortcode in another would work. But if not, perhaps the image shortcode could be updated to use |
Oh, and the |
This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help. |
Still think it's relevant to have a unified way to link to files within a bundle. |
You can. I will explain, but add that the internal shortcodes of Hugo is a little bit behind the whole "bundle thing". But that does not mean that you cannot create your own shortcodes that will support this: If this was you calling your custom image shortcode:
And then in your
There are lots of additional possibilities to the above (image processing etc). /cc @kaushalmodi |
Yeah, I have this shortcode:
I call it like this:
And it, in turn, calls this partial:
I admit I've not had my head in Hugo for a while, so I don't recall exactly why I wrote it this way. I've just been depending on this as-is. And while it works well enough, it feels pretty hackish. But perhaps I've overlooked something. |
To get back to the OP, can you do something like:
And nest it inside another shortcode?
PS: Amused that my spell-checker keeps correcting "shortcode" to "shortcake". |
The figure shortcode can be updated using the various techniques discussed above:
I can work on a PR that solves both of the above issues. Would that be accepted? (Is that why I was Cc'ed? :)) |
No. I will close this issue now. I don't know how such a shortcode would/should look like. But this issue is not the correct medicine. You should continue any discussion at the forum. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Followup from #4803. The issue is to have a reliable way to specify relative and absolute URLs as well as page bundle reference URLs when writing a content document. The use case would be to reference documents in a bundle, files elsewhere in the hierarchy (e.g., a static image), and reliably get the proper URL given the base URL, including a path prefix. One ought to be able to use such a feature either on its own:
Or in combination with shortcodes:
Some examples of major use cases:
The text was updated successfully, but these errors were encountered: