2

I'd like to use org-mode macro replacement to expand macros inside HTML blocks in org-mode export to HTML.

I'd like this...

#+MACRO: event-url bar
#+HTML_HEAD: <meta property="og:url" content="http://foo.com/{{{event-url}}}"/>

...to export HTML that looks like this:

<HEAD>
<meta property="og:url" content="http://foo.com/bar'/>
</HEAD>

Based on this I tried this:

#+begin_src emacs-lisp :results silent
(add-hook 'org-babel-tangle-body-hook
        (lambda () (org-export-preprocess-apply-macros)))
#+end_src

#+BEGIN_EXPORT html :tangle yes
<HEAD>
<meta property="og:url" content="http://foo.com/{{{event-url}}}"/>
</HEAD>
#+END_EXPORT

...but that didn't work either.

How can I expand org-mode macros in HTML blocks in export to HTML?

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.