org-mode image location

I did not like the limited options offered by the orgmode plugin that came with nikola. It suggests using img-url: link which does not allow me to add ATTR_HTML or a CAPTION that comes nicely with org-export.

Let's add an image here:

cat/spider image

Figure 1: Image from cannon.js

This was added as

#+CAPTION: Image from cannon.js
#+ATTR_HTML: :alt cat/spider image :title Action! :align center :width 200
[[../../images/org-mode/cannon_js.png]]

Now, we also create a symbolic link to files/images in order to point the final location of the images/ directory that should be added to files/ directory. The images/ final output location will be at / which is located two back references from the posts directory.

Adding a symbolic link in the source branch allows one to visit the link in org-mode, while at the same time point to the correct output directory.

cd $nikola_root
mkdir -p files/images/org-mode
# move cannon_js.png into this directory
ln -s $(pwd)/files/images ../images

Comments

Comments powered by Disqus