From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id mKonJ+4kuGYOYAAA62LTzQ:P1 (envelope-from ) for ; Sun, 11 Aug 2024 02:41:50 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id mKonJ+4kuGYOYAAA62LTzQ (envelope-from ) for ; Sun, 11 Aug 2024 04:41:50 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1723344110; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=sKZ67izgndBgZu5W9ZdFEO47rwI4oShD7NDIuKA6QQ0=; b=dNDI0IcZEMyaYR+yzJw3Rs/c5Nx09+bV0sgQkJJueSmayvArH9Za1+HNa+We0f8AXdP06v tvBW5jwJES+RCyFfaBXv5G3/zT1MTPBRNC/d2XxEvhClDdGMaoye64SAGLiEMkVIa4DI6k rFdDSVh5h5CTC6O+asrZ4BXjkYdMxl/diJLb3TWlUYfmPulG0i+ZLkk9WoVfGjlifD36vB aZSMePQz737fIj2rbtUNx674Zvzgc97Bl4wNFTQ7KT47+ZAQDypbWq2MoQu3J7Z9+N60/H qjVFG3P/3eW0NsulTQJ/99tCLBMIKyhrO5zIY5HR3qLYwfH95RLNF8JsJGTyCA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1723344110; a=rsa-sha256; cv=none; b=onMij2airlcNbhSdyE/m3kvxuOi0v0w2Xl4KzjRXRw+78045Gi1GaYa8nC76tVyuwVi+6C ENsbM0q1bNBNq+kVVnLTS+tE799vRN/8C4dp1SsJIyUxZwA4rqH2ykox6eV1ku1ABS/AdD TrHhO4As9uJWwjms9PJ1bRFhgjDx7JSTCRz20dlRAZpS014MU3p4xPMaKK/EcjZ0cF4IaB T2LLPrZPM8rBP8bIucPbvq+K9f7wkAhhSTaV7In5vr/iofOI6qyr0TiBCBIwZsAO5r5Fx7 EuXy9nqVbQ2cQ4pqvD5aw80ZSA3ChlHak1cazOY22uMa61q7qVU3BfRt3flB2g== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 04BB72720D for ; Sun, 11 Aug 2024 04:41:50 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1scyVi-0002d3-5D; Sat, 10 Aug 2024 22:40:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1scyVg-0002cu-2T for emacs-orgmode@gnu.org; Sat, 10 Aug 2024 22:40:44 -0400 Received: from 96-100-31-185.ftth.cust.kwaoo.net ([185.31.100.96] helo=k-7.ch) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1scyVd-0000aj-QH for emacs-orgmode@gnu.org; Sat, 10 Aug 2024 22:40:43 -0400 Received: from van (_gateway [192.168.1.1]) (Authenticated sender: seb) by k-7.ch (Postfix) with ESMTPSA id 9ED8CE8117 for ; Sun, 11 Aug 2024 04:40:36 +0200 (CEST) From: =?utf-8?Q?S=C3=A9bastien_Gendre?= To: General discussions about Org-mode Subject: Org-publish and attachment links User-Agent: mu4e 1.12.1; emacs 29.4 Date: Sun, 11 Aug 2024 04:40:21 +0200 Message-ID: <87h6br4wa2.fsf@k-7.ch> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Received-SPF: pass client-ip=185.31.100.96; envelope-from=seb@k-7.ch; helo=k-7.ch X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RDNS_DYNAMIC=0.982, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, TVD_RCVD_IP=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -8.55 X-Migadu-Queue-Id: 04BB72720D X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -8.55 X-TUID: 9bwyapYvktiL --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, # TL;DR When I export Org-mode documents with org-publish, it cannot resolve links in format "[[attachment:image.png]]". But when I export manually the same document with the export dispatcher, the export work correctly and the attachment link is correctly resolved. I don't know if it's a bug, or if it's planned to work like this and a feature suggestion is needed. So, I post a message here. # Context I plan to write a little web documentation with Org-mode. The documentation is split into multiple Org-mode files that I put into a "./Pages/" folder. Each org-mode document are converted to HTML with org-publish and the function `org-html-publish-to-html`. The result is written into the "./Public" folder. And there is 2 kind of statics files: * The ones needed on each pages, like the website logo or the CSS * The files related to a specific page, like a screenshot For the first kind, I have a "./Static/" folder which content is copied to "./Public/static/" with org-publish and the function `org-publish-attachment`. For the second type, I use the Org-mode feature "attachment" to attach each files into an Org-mode heading and (in my Org document) I write an attachment link like these: [[attachment:image.png]] [[attachment:code_template.tar.gz][Template of code]] To publish these files, I also use org-publish and the function `org-publish-attachment`. This time, from the folder "./Pages" to the folder "./Public". # How to replicate this problem For this, I skip the CSS+JS folder. 1) Create directory called "test_documentation". 2) In "test_documentation/", create 1 directory: * "Pages" 3) In "Page/", create 1 file named "Example.org" 4) In "Example.org", create a heading, attach a image file to it and make an attachment link to this file (like "[[attachment:image.png]]") 5) In "test_documentation/", create a file named "publish.el" and write this content in it: ;; Publish script for the website =20=20=20=20=20=20=20 =20=20=20=20=20=20=20 ;; Package load and configuration =20=20=20=20=20=20=20 ;; Use org (use-package org) =20=20=20=20=20=20=20 ;; Use ox-publish (use-package ox-publish) =20=20=20=20=20=20=20 =20=20=20=20=20=20=20 ;; Set publication configuration (setq org-publish-project-alist '(("pages-org" :base-directory "./Pages/" :base-extension "org" :publishing-function org-html-publish-to-html :publishing-directory "./public/") ("pages-attachment" :base-directory "./Pages/" :base-extension "jpg\\|png\\|gif\\|svg\\|zip" :recursive t :publishing-directory "./public/" :publishing-function org-publish-attachment))) =20=20=20=20=20=20=20 =20=20=20=20=20=20=20 ;; Do the publication (org-publish-all t) 6) Run this publish script with this command: emacs -q --script publish.el # What did I=C2=A0get An error message: Error: user-error ("Unable to resolve link: \"attachment:image.png\"") mapbacktrace(#f(compiled-function (evald func args flags) #)) debug-early-backtrace() debug-early(error (user-error "Unable to resolve link: \"attachment:i= mage.png\"")) user-error("Unable to resolve link: %S" "attachment:image.png") org-export-data=E2=80=A6 I cut from the org-export-data, because it is amazingly long and didn't add any useful info. # What did I expected Attachment link would be resolved like with manual HTML export. # Versions * Emacs: 29.4 * Org-mode: 9.6.15 Best regards --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQI/BAEBCAApFiEEaA9vw9ypVj1kP0tAtYb3x3I54p4FAma4JJULHHNlYkBrLTcu Y2gACgkQtYb3x3I54p6LVhAA2dTd5R3eGguBSCMpt2HK4LKANDBsYtXMapNykOst 2gt2WTc/gxXmGQr9T/PdFEX4/zAZEPR/rkBayBtF9asZ6j1S11c404tP4G6e42pQ PfgrJyo839riXWSgRSlcVxU0+dvojaifr0tuuZnoijlpr6Jp2tsFwVPFZH1HYPAK FJroID7UyniveYfTOMUUoQee5WDmlskTq4g+vKHWZs9o/Z7FHUPqa+p2o0Xx+IKE DWwD6at1xViPSNbI/R9UIgn7qj+Kkmeqok3QpiPE2Uay9XyYLxGNCjbL40whs/i8 xZ/44SGUNBLro3zc5dVzpdTS7mr2GFZDRVSd/Gn3Po42ojzJsMs0BDyomL9N9GNp ZxzybqpHEh2ZFvW2bQlOZbcxANoF4N1IsIjhPtmT7wCLLhQ56NdUyKy3iFhsDIWa PUy/A+Y8snfrkjbjbOSlKayxOMs//E5bnOexgO8DqcJ1YhLNvCAIOCtBqPoLrVzB Lhtr6uKmvoI0pnom6A4PtKS3e+AAIJO5huuFxQs1/kG3bMCbETEijT5Bf5e8dsYU NHnWNsWcuU/XZM7RQJeyeJcIVFNCAj0Q8fCll38hkhhbj9qB6zeixuOAOrvosZ5K X9snro6B5WCwRqi/O3Qo914nM1Li6Ao6/FVxrIT8ZEnAYxnAjpXAa91BnNgTAKhf MG4= =hjHK -----END PGP SIGNATURE----- --=-=-=--