-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Ghost 2.0's zip file import does not update relative image paths as indicated in the docs when using mobiledoc cards #9821
Comments
After I upgraded from ghost 1.25.4 to 2.0.3 I have an issue with the new editor. In ghost 1.xx I used relative paths to refer to my pictures. The editor is now confused with this:And here you see the broken image:But once published, the picture appears normallyTechnical details:Ghost Version: 2.0.3 |
@ageitgey do you share the Medium-to-Ghost utility publicly? I would be curious to try it! |
@pascalandy Sure, I just posted it here: https://github.com/ageitgey/medium_to_ghost |
@kirrg001 You tagged this as |
@ageitgey Thanks for the Medium to Ghost utility - i have added your repository link to our importer docs 🙂 I can confirm, this does not work. I have updated our 2.x importer docs. The importer logic must check if the card src matches any image from the uploaded zip. Only then we should add the This is the code section which probably needs a tweak. PR is welcome 👍 |
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. |
We will be revisiting the importer after the ongoing API work. |
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. |
Issue Summary
I wrote a Medium-to-Ghost utility that converts all the user's Medium posts into Ghost 2.0-compatible mobiledocs and creates an import zip file for Ghost containing a .json and the associated images. In general it works amazingly well and the result in Ghost is nearly identical to what the user had on Medium. Nice job with 2.0!
To include images in the Ghost mobiledoc posts, I'm inserting a mobiledoc
card
of typeimage
with thesrc
set to the local path of the corresponding image in the zip file.According to the docs:
However, this is not true when importing mobiledoc image cards. Ghost does not seem to update the image paths as it says.
Example: If an imported post's
mobiledoc
has an image card that refers tosrc: "/medium_images/my_image.jpg"
, the imported post will have a broken image pointing to http://mydomain.com/medium_images/my_image.jpgThe only way to generate an imported post with working images is to create the mobiledoc image card with the
src
attribute pointing to the full final path of the image after importing, i.e./content/images/medium_images/my_image.jpg
on my development installation.To Reproduce
Expected result: Post will have working image
Actual result: Post will have broken image link
Technical details:
The text was updated successfully, but these errors were encountered: