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
Make figure SC insert absolute links in the src attribute #4803
Conversation
- Fixes gohugoio#4562 - So now the figure shortcode inserted images work fine on list pages and on sites with baseURL containing subdir too. - Support figure SC src attribute with protocol or two leading slashes - Update the figure shortcode + src attr tests to use BaseURL - Add tests for all of the above. Other: - White-space change syncup between figure SC and tests - Consistency edits: {{.}} -> {{ . }}, {{else}} -> {{ else }}, and similar
e023a90
to
384b350
Compare
AbsURL is so close already; would be nice if the |
When I see constructs like the below I think it is time to stop and try to improve:
So, if we skip the We probably need a better name for it. But method like that would make this a lot more solid. Also, see #4574 |
Also, I thought this discussion was "how to reference an image in a page bundle"; the cleanest way of doing that is to find the image resource in the page bundle and call |
So should there be a method on the Page object to which one can pass the name of a file in the bundle and get back a URL? I think the image shortcode needs to be able to handle all the possibilities, since one can't tell in advance whether the
|
I don't know how As @theory mentioned, it would need to handle all those cases at the But rather than having |
I looked at the
|
@theory Your edit in #4803 (comment) looks nice. Can you open a new issue proposing this new function? You also look better qualified to propose a PR for that as I don't code in Go. We can discuss further over there, including discussing a name for that function.. And I will close this PR for the sake of "the right thing to do" i.e. have a "Page.AbsURL" :) |
Done in #4804. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
sites with baseURL containing subdir too.
Other: