Closed abhinavpreetu closed 4 years ago
Using public_folder
isn't a workaround, it's the feature that provides support for your use case. This issue would be better presented as a feature request for automatically detecting site root from your SSG config. It's non-trivial as site generators vary, and a new extension interface would need to be defined and implemented to do it right, but we should at least start the conversation: #2347
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Describe the bug Failing to load images in the website as well as the preview section for sites in a sub-folder. For instance,
www.example.com/netlify-cms-demo/
.To Reproduce
Expected behavior The images should load irrespective of the sub-folder deployment. The request for the images go to
www.example.com/img/sample.png
. But ideally it should go towww.example.com/netlify-cms-demo/img/sample.png
. I am using Gatsby along with netlify-cms.Applicable Versions:
CMS configuration media_folder: static/img public_folder: /img
Additional context I resolved the issue by prepending the sub-folder name to the
public_folder
property likeAs I am using Gatsby, they handle the sub-folder issue using the property
pathPrefix
in thegatsby-config.js
file. Similarly Hugo hasbaseUrl
. If possible, canconfig.yml
read thepathPrefix
property ingatsby-config.js
or similar properties from other site generators and append it to thepublic_folder
?