Zola with images

tl;dr
- Markdown image syntax is
 - Absolute paths work for pictures in the
staticfolder:- locate
static/<subfolder>/<imgname.png>by the path/<subfolder>/<imgname.png>
- locate
- Relative paths work for "co-located assets," e.g.
<imgname.png>
Sources:
- Zola docs: Content Overview/Asset colocation
- Zola forums: figuring it out
- Core Markdown (Commonmark)1
- Markdown Cheatsheet
What is Markdown image syntax?
Markdown image syntax is . You should put a description of the image in <alt text> for accessability and organization, since:
<alt text>is displayed when the image fails to load<alt text>is read-aloud to visually impaired readers<alt text>is scanned by search engines to classify webpages
How do I include images for posts?
You can include an image in a webpage with 4 steps.
- Make a directory for the webpage inside the
contentdirectory. - Put an image file inside your newly made webpage directory.
- Create a file named
index.mdwith the content of the webpage - Inside
index.md, writeto include the image.
You can use the img-filename to include the image because the
image and webpage share a directory.
Note that the directory name becomes your webpage link.
Why does this work?
Zola notices the structure of the content directory:
.
|
+-- content
|
|--some-imgless-post.md
|
+-- directory-for-the-page-with-images
|
|— index.md
|
|— your-img.png
Whenever Zola sees a directory inside content with an index.md file, it
preserves that structure. So,index.md is always within the same directory as
your-img.png. Since your-img.png is in the same directory, it can be
located by just its name.


What if I want to re-use the same image on multiple pages?
Here we use the static folder to bring-in photos that we'll use
multiple times across the site. Using the static folder ensures that the file
is only copied once but can be used at multiple places! Handy for icons and the
like.
.
|
+--static
|
+--<img-directory>
|
+--<re-used-img.png>
With ^ the above directory structure, <re-used-img.png> can be included in any
webpage with the markdown syntax:

So, now that we're cool:


Footnotes aren't guarenteed to be supported by commonmark, but might be, depending on theme.