The Markdown form [{{< figure .. >}}](some link) results in wrapping
the <figure> in <a> in the final HTML, which is invalid.
- [X] Non-inlined hyperlinked images -- Use link in figure
https://github.com/kaushalmodi/ox-hugo/issues/125
One minor behavior change: Now <a> tag attributes like "target" and
"rel" cannot be applied *only to* the links that images hyperlink
to. The reason is to make the exported Markdown generate valid HTML,
and with how the "figure" shortcode is designed in HTML, those
parameters are not passed onto the <a> element in the generated
<figure> element.
Fixes https://github.com/kaushalmodi/ox-hugo/issues/124
Remove the logic clutter that tried to preserve "file:" before
links.. "file:" does not make sense for web pages (may be need to
revisit this in future, but for now all existing tests pass).
- Add tests for images linked to images when the linked image needs to
be copied to static.
- Another test similar to above but when the page is a bundle and the
linked image needs to be copied to the bundle dir.
- Also update test site theme
Add org-hugo-external-file-extensions-allowed-for-copying,
org-hugo-default-static-subdirectory-for-externals.
Copy external files to Hugo static only if they are newer or don't
exist in the destination dir.
Earlier, the images/ directory was given too much prominence... all
users might not have just an "images/" dir in the "static/" dir. A
user could have multiple dirs inside their static/ dir.. but earlier
the rewrite only used to happen to static/<HUGO_STATIC_IMAGE>. That
did not look right.
This commit fixes that.
Now ox-hugo tries to be smarter in figuring out where to copy the
outside-Hugo-static-dir files to.
- Now the <!--listend--> and <!--quoteend--> comments are not inserted
unless needed.
- Fix the "example-site/content/posts/equation-latex-frag.md" example.
User can still override this default by using:
#+OPTIONS: ':t
The default smart-quoting by Blackfriday is good enough. As a side the
Markdown files are much more human-readable with the
single and double quote characters used instead of rsquo, lsquo, rdquo
and ldquo.
* ox-hugo.el (org-hugo-link): Update the type=="file" case in the
final t case of the cond. Now the file:// prefix is not added if
the raw-path begins with "/images/" (or "/HUGO_STATIC_IMAGES/").
Cleanup:
- Move raw-path to the first let form in org-hugo-link; no need to get
that value multiple times in the fn.
- Get value of :hugo-static-images from info
- Replace occurrences of:
(if (not foo) bar
baz)
with
(if foo
baz
bar)
- Misc code consistency edits