1

I'm trying to follow the recipe for exporting Org-mode documents for processing by Jekyll. My publishing org-publish-project-alist is configured to place exported html in my _posts directory and take images and place them in _posts/assets with org-publish-attachment. This modification of directory structure seems to be the root of the problem.

#+BEGIN_SRC python :results value file
  import numpy as np
  import matplotlib.pyplot as plt

  from mpl_toolkits.mplot3d import Axes3D

  p1 = np.array([0,4,4])
  p2 = np.array([4,-4,4])
  p3 = np.array([2,2,-4])

  fig = plt.figure()
  ax = fig.gca(projection='3d')
  ax.set_aspect("equal")

  #draw the arrow
  ax.quiver(p1[0],p1[1],p1[2],p2[0],p2[1],p2[2],length=1.0)
  ax.quiver(p1[0],p1[1],p1[2],p3[0],p3[1],p3[2],length=1.0)

  ax.set_xlim([-5, 5])
  ax.set_ylim([-5, 5])
  ax.set_zlim([-5, 5])

  plt.savefig('../images/hw1-p3.png')
  return '../images/hw1-p3.png'
#+END_SRC

#+RESULTS:
[[file:../images/hw1-p3.png]]


#+BEGIN_EXPORT html
<figure>
  <img
  src="{{ site.url }}/assets/hw1-p3.png"
  alt="Problem 3 visualisation">    
  <figcaption>Problem 3 visualisation</figcaption>
</figure>
#+END_EXPORT

The end result I would like is to have the link to the result of the literal code block automatically generated either such that it is not exported as an inline image (as the relative path is incorrect) and be forced to manually add a correct link for HTML export or have the inline image link transformed such that it is correct.

Org-mode newbie! Suggestions like "Don't use Jekyll" are fine so long as it is accompanied with an alternative and explanation as to why. I see some people have written custom Org-mode Jekyll plugins like https://github.com/eggcaker/jekyll-org and am wondering if these are a better route.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.