There are multiple places where you need to specify URLs to pages or paths to media files within your content. That may be a link within your markdown or a paramter for a tool or extension represented by a variable. In this regard there are some rules to be observed.
When linking to pages it is important to understand how Automad is rewriting URLs and to differentiate between relative and absolute links.
Linking to pages relatively works quite self-explanatory. You can simply link from
http://yoursite.com/page/subpage by simply using
subpage as URL. To link to any page on the same level, next to
Absolute URLs (starting with a
/) specify locations relative to Automad's base directory. It is important to understand that you do not have to prepend the base URL of your Automad installation.
The root directory
/is always the Automad base directory and not the server's root!
For example, if you install Automad in a subdirectoy of your page like
http://domain.com/automad-subdirectory, linking to
/ will link to
http://domain.com/automad-subdirectory and not to
http://domain.com. All URLs get automatically resolved to your real base URL to maintain portability.
Generally, unlike linking to pages, files have a "real" path and not a virtual URL. The real path is the actual full file system path of the file like
/pages/01.pagename/filename.png and NOT
Whenever Automad finds a link using a relative path to a file or just a filename like
image.png, that link gets resolved relative to the current page's file system path. So linking to
image.png is enough, as long as a file with that name is stored in the page's location.
When linking to files in another location than the page's directory, it is recommended to use absoulte paths, starting from Automad's installation directory, for examplte
Note that you can use the Copy URL to Clipboard button in the Files tabs to get a valid URLs.
There are many places, where a variable is used to define a file selection. Usually those variables expect glob patterns. For example, in case your template has a gallery or slideshow, you might have a variable to define the images to be used. Using
*.jpg will select all JPG files in the page's directory while
gallery_*.png will select all PNG files starting with "gallery_". It is also possible to use more complex patterns like
/pages/*/*.jpg to select all JPGs of all first level pages and so on. You can specify multiple patterns or files by separating them with a comma as follows:
galleryImages: *.jpg, *.png /shared/gallery_*
The above line will select all
.png files within the page's directory as well as all files within the
/shared directory starting with "gallery_".