Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to include files but in other directories--is this possible? #2114

Closed
joelouthan opened this issue Jul 6, 2023 · 1 comment
Closed
Labels
C-question Category: A question on how to do something

Comments

@joelouthan
Copy link

Question

In mdbook, here is my structure:

src/
 |-bibliography/
            |- biblio-sources.md
 |-confession-1689/
            |-1689-00-intro.md

In 1689-00-intro.md, I want to use {{#include}} to biblio-sources.md

When I do {{#include /bibliography/biblio-sources.md}}, I get this

2023-07-06 08:21:26 [ERROR] (mdbook::preprocess::links): Error updating "{{#include /bibliography/biblio-sources.md}}", Could not read file for link {{#include /bibliography/biblio-sources.md}} (/bibliography/biblio-sources.md)
2023-07-06 08:21:26 [WARN] (mdbook::preprocess::links): Caused By: No such file or directory (os error 2)

I can use ../bibliography but that breaks the image src inside of the file.

Is this even possible with {{#include}}?

Thank you.

Version

mdbook v0.4.30
@joelouthan joelouthan added the C-question Category: A question on how to do something label Jul 6, 2023
joelouthan added a commit to joelouthan/Theologicus that referenced this issue Jul 6, 2023
@ehuss
Copy link
Contributor

ehuss commented Jul 6, 2023

Includes need to be relative to the file they are included from. Absolute links for things like images aren't directly supported (some work is being done in #1802 to address that).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-question Category: A question on how to do something
Projects
None yet
Development

No branches or pull requests

2 participants