Ability to set the base URL for formats other than HTML? #13000
Replies: 2 comments 7 replies
-
Can you detail what you mean? What local file paths exactly? Using a Quarto Website, if you include a PDF, it will be downloadable from a URL that includes the site URL. For example Lua quick reference guide linked from https://quarto.org/docs/extensions/lua.html
A link to the document deployed in the same folder or nested folder is usually relatively included, and the site URL where the document is deployed will be used.
I see the pandoc issue is discussing root path for image. Is that the use case for site-url for single document ?
Some metadata are passed.
It would really help us if you can share a real case example of Thank you ! |
Beta Was this translation helpful? Give feedback.
-
Sure! There might be some misunderstanding so I've made a minimal demo site to make it clear. The source code can be found at sun123zxy/quarto-discussion-13000. The actual case here is to provide both a web page version and a PDF version of a QMD file in a website project, that is, having both In the index page of the demo site, there are two links and an image. The first link is
Above shows that in a website project, links in the formats other than HTML are not handled identically with those in HTML --- not prefixed by a base URL (thus referring to local file path), and no special treatment for links to
Maybe that's why images work well in the above demo? Note that this Pandoc issue is also discussing the root path for links.
Regrettably I haven't really come up with a specific use case. I thought this was somehow an intermediate step to resolve the above issue. If it is not, feel free to ignore this :) Thank you for your time! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
In a website project we have the metadata
site-url
to indicate the base URL of the site. This is well implemented in the HTML format, but it would be useful to have a similar feature for other formats like PDF.For a use case, consider a website project with PDF versions of the content. PDF files are intended to be downloaded and viewed offline, but without a base URL, the relative links in the PDF files point to local file paths, which is clearly not what we want. More generally, it calls for an option to set the base URL for an independent document, not necessarily by
site-url
, which is only available in a website project.To the best of my knowledge, there's no built-in way to set a base URL for formats other than HTML in Quarto. Actually this had been discussed in a Pandoc Issue, though currently there're only manmade Lua filter resolutions. Speaking of
site-url
, it's also awkward for Lua filter to workaround, because Quarto's project metadata is not passed to the Pandoc context.It would be nice if above is supported by Quarto in some form. Correct me if I'm missing something obvious. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions