-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.qmd
80 lines (51 loc) · 2.44 KB
/
index.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
title: "Keeper Image"
image: https://keeper.mpdl.mpg.de/f/ec510a79d3ab495eaf67/?dl=1
about:
id: hero-heading
template: trestles
links:
- icon: github
text: GitHub
href: https://github.com/lnnrtwttkhn/keeper-image/
---
The source repository of this website can be found [on GitHub](https://github.com/lnnrtwttkhn/keeper-image/).
The problem described on this website is also [documented as an issue](https://github.com/quarto-dev/quarto-cli/issues/4640) on the `quarto-cli` GitHub repository.
## Problem
Quarto HTML document does not display image downloaded from a publicly accessible cloud share provider (here: [Keeper](https://keeper.mpdl.mpg.de/)).
## Example
Here is the link to the Keeper logo: [https://keeper.mpdl.mpg.de/media/custom/KeeperLogo.svg](https://keeper.mpdl.mpg.de/media/custom/KeeperLogo.svg)
I can embed it in Markdown using the `![]()` Markdown syntax:
```
![](https://keeper.mpdl.mpg.de/media/custom/KeeperLogo.svg)
```
![](https://keeper.mpdl.mpg.de/media/custom/KeeperLogo.svg)
Here is the link to the same logo, stored in a Keeper library: [https://keeper.mpdl.mpg.de/f/ec510a79d3ab495eaf67/](https://keeper.mpdl.mpg.de/f/ec510a79d3ab495eaf67/)
Again, I want to embed it in Markdown using the [direct download link](https://keeper.mpdl.mpg.de/f/ec510a79d3ab495eaf67/?dl=1):
```
![](https://keeper.mpdl.mpg.de/f/ec510a79d3ab495eaf67/?dl=1)
```
![](https://keeper.mpdl.mpg.de/f/ec510a79d3ab495eaf67/?dl=1)
Can you see the logo?
No, right?
But the same thing works for the [README.md](https://github.com/lnnrtwttkhn/keeper-image/blob/main/README.md) on GitHub ...
:::{#hero-heading}
... and also for the link provided to the `image` field in the YAML header when using the [About Pages](https://quarto.org/docs/websites/website-about.html) template.
:::
**Why?**
## Workaround: Pre-render
One workaround is to execute a script that downloads images from the cloud storage as part of the [`pre-render` options in Quarto](https://quarto.org/docs/projects/scripts.html#pre-and-post-render).
Here is one approach:
1. We create a Makefile command `prepare` that uses `wget` to download the image from Keeper:
```Makefile
prepare:
wget https://keeper.mpdl.mpg.de/f/ec510a79d3ab495eaf67/?dl=1 -O KeeperLogo.svg
```
2. We include `pre-render: make prepare` in `_quarto.yml`
3. We include a path to the downloaded file:
```markdown
![](KeeperLogo.svg)
```
This is the outcome:
![](KeeperLogo.svg)
Cool! 🎉