Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9274657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:24:17+00:00 2026-06-18T16:24:17+00:00

I need to export absoluted Image url in html in emacs org-mode file: when

  • 0

I need to export absoluted Image url in html in emacs org-mode file:

when i write the following code:

[[file:/images/a.jgp]]

export of html code is :

<img src="file:///images/a.jpg" >

but which i need is :

<img src="/images/a.jgp">

so how can i export what i wanted , instead of use #+BEGIN_HTML tag ?

ps: my emacs config:

 16 ;; org-mode project define
 17 (setq org-publish-project-alist
 18       '(
 19         ("org-blog-content"
 20          ;; Path to your org files.
 21          :base-directory "~/ChinaXing.org/org/"
 22          :base-extension "org"
 23 
 24          ;; Path to your jekyll project.
 25          :publishing-directory "~/ChinaXing.org/jekyll/"
 26          :recursive t
 27          :publishing-function org-publish-org-to-html
 28          :headline-levels 4
 29          :html-extension "html"
 30          :table-of-contents t
 31          :body-only t ;; Only export section between <body></body>
 32          )
 33 
 34         ("org-blog-static"
 35          :base-directory "~/ChinaXing.org/org/"
 36          :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf\\|php\\|svg"
 37          :publishing-directory "~/ChinaXing.org/jekyll/"
 38          :recursive t
 39          :publishing-function org-publish-attachment)
 40         ("blog" :components ("org-blog-content" "org-blog-static"))
 41         ))
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T16:24:18+00:00Added an answer on June 18, 2026 at 4:24 pm

    The way to do this is to register a new kind of link in org-mode, using org-add-link-type. That lets you supply a custom export format.

    org-add-link-type requires a prefix, a “what happens when you click the link?” function, and an export function.

    I use a prefix of img, so my links look like [[img:logo.png][Logo]].
    My image files are in ../images/ (relative to the .org files), and from the webserver they show up in /images/. So for those settings, putting this in .emacs provides the solution:

    (defun org-custom-link-img-follow (path)
      (org-open-file-with-emacs
       (format "../images/%s" path)))
    
    (defun org-custom-link-img-export (path desc format)
      (cond
       ((eq format 'html)
        (format "<img src=\"/images/%s\" alt=\"%s\"/>" path desc))))
    
    (org-add-link-type "img" 'org-custom-link-img-follow 'org-custom-link-img-export)
    

    You’ll probably need to amend the paths for your setup, but that’s the recipe. As you’d expect, C-hforg-add-link-type will give you the full gory details.

    Oh, and for what it’s worth, here’s the code I’m using for inter-post links (like [[post:otherfile.org][Other File]]). There’s a little Jekyll magic in the output format, so watch the double-%s.

    (defun org-custom-link-post-follow (path)
      (org-open-file-with-emacs path))
    
    (defun org-custom-link-post-export (path desc format)
      (cond
       ((eq format 'html)
        (format "<a href=\"{%% post_url %s %%}\">%s</a>" path desc))))
    
    (org-add-link-type "post" 'org-custom-link-post-follow 'org-custom-link-post-export)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to export a gridview to excel, I put the return html code
being in need to export a DOC file to TXT and then reimport it
I need to export a table from phpmyadmin to a comma delimited text file.
I need to export UITableViewCell into an image PNG or anything so I can
we have the need to export a csv-file comprising data from the model from
i need to export my sql-server database to an excel file between day x
I need to Export some PNG Images with Transparent Background from a C# Application
I need to export an HTML page with some charts in to a PDF,
I need to export a huge php multidimensional array containing the following structure: [0]
I need to export data to a file from a huge table with only

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.