Hi,
I’m making a short code for linking to java doc.
The with-frame java docs is a bit crazy, as it wants href to be ....?../.../
, and replacing / by %2f doesn’t work. ( e.g. https://docs.oracle.com/javase/7/docs/api/index.html?java/lang/System.html )
My shortcode is simply
<a href="https://docs.oracle.com/javase/7/docs/api/index.html?{{.Get 0}}"> {{.Inner}}</a>
And usage is
{{% ref "java/lang/System.html" %}} System {{% /ref %}}
This results in
<a href="https://docs.oracle.com/javase/7/docs/api/index.html?java%2flang%2fSystem.html"> System</a>
I tried various functions in shortcode, but nothing generates the ‘/’ .
Now, the question is, how to make hugo emit ‘/’ instead of ‘%2f’, after it has seen the ‘?’ of href ?
I’ld prefer to handle it in shortcode, rather than md,
–
Regards