The Media Library allows content editors to easily manage the media for your site. This allows content editors to easily add images, PDFs, and GIFs to their content without having to use Git.
To upload media files to the Media Library, navigate to the Media Library page in Forestry, and follow these instructions:
- Click the “+” thumbnail
- Select a media file to upload from your local machine
- A loading spinner will be displayed while the media file uploads
You can also upload media files by dragging them from your desktop onto the Media Library. Give it a try!
To delete media files, navigate to the Media Library page in the CMS, and follow these instructions:
- Click “Select” on the thumbnail of each upload you’d like to delete
- Click the trash icon in the top right corner of the page
- You can confirm that each upload is being deleted by checking Site Activity in the top right of the sidebar
If you deleted a media upload by accident, worry not! All media uploads are stored in your Git repositories history.
Configuring the Media Library
The Media Library displays media files found inside a single uploads folder. This can be configured from your site’s settings.
The upload path where media uploads should be saved, relative to the root of your repository.
Front Matter File URL
The relative path from the root of your site for media uploads inserted into front matter fields.
The Front Matter File URL may need to be different than the Content Body File URL if your theme handles appending the path to the media upload.
Content Body File URL
The relative path from the site’s root for media uploads in the content body.
The Content Body File URL should always be the relative path to your media uploads folder from the root of your site to ensure that images load correctly.
Each of these settings support the following variables at upload time:
:year:: the current year, formatted
:month:: the current month, formatted
:day:: the current day, formatted
Caught a mistake or want to contribute to the docs? Edit this page on Github!