Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom jekyll source directory breaks image uploads #973

Open
travis opened this issue Jun 7, 2016 · 3 comments
Open

Custom jekyll source directory breaks image uploads #973

travis opened this issue Jun 7, 2016 · 3 comments

Comments

@travis
Copy link

travis commented Jun 7, 2016

When jekyll is configured to use a custom source directory, setting prose.media in _config.yml will correctly cause drag-and-drop image uploads to land in a custom directory, but the markdown link created by that process will be wrong.

Repository demonstrating issue here:

https://github.com/travis/prose-alternate-source

To reproduce, go to http://prose.io/#travis/prose-alternate-source and create a new file. Drag an image into the new post and save. Notice that the image is uploaded to src/blog/media but the link also includes src/blog/media in its src attribute. After generate, the image will actually live in /blog/media (no /src) but there is no way to tell prose about this. As a result we need to manually edit generated links.

My prefered resolution would be some sort of option to configure image link prefixes.

@tfe
Copy link

tfe commented Jun 8, 2016

The solution I would propose for this would be to allow customization of the image markdown template that Prose inserts after an upload.

This would cover the original case in that one could set the prose.media path to wherever the images should actually be stored, and provide a custom path to the image in the image insert template.

But beyond the original case, this would allow for a lot of flexibility. One example I've encountered is that I can't use images uploaded through Prose with jekyll-assets to get desirable asset fingerprinting and caching behaviors, since I need to use the asset_path helper to refer to them. If Prose allowed me to provide a custom image template, I could easily use the helper in that.

@dereklieu
Copy link
Member

Toolbar.js already checks for prose config, setting a template wouldn't be a huge lift and I'm open to making it a feature, but I think fixing the prose.media bug @travis raised should take precedent, as it should just work and not everyone will know to write a custom template.

I don't have the bandwidth for this right this moment but if anyone wants to work on it I'm happy to point them in the right direction and assist with writing tests.

@tfe
Copy link

tfe commented Jun 13, 2016

OK sounds reasonable. I'll open a new issue for jekyll-assets compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants