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

feat(import_image): replace image embed link with relative path #72

Merged
merged 2 commits into from
Jul 21, 2020

Conversation

curbengh
Copy link
Contributor

Continue #70

Downloads all image attachments and save them according to their respective directories.
Example: http://yourwordpress.com/wp-content/uploads/2020/07/image.jpg => http://yourhexo.com/2020/07/image.jpg.

I'm assuming Wordpress store images like this:

http://yourwordpress.com/wp-content/uploads/2020/07/image.jpg
http://yourwordpress.com/wp-content/uploads/2000/01/image.png
http://yourwordpress.com/wp-content/uploads/2005/08/image.gif

After importing the images, with this PR, the original image embed will be automatically updated:

![caption](http://yourwordpress.com/wp-content/uploads/2005/08/image.gif)

becomes,

![caption](/2005/08/image.gif)

Not compatible with post_asset_folder: true config yet.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.4%) to 95.455% when pulling 93468e1 on curbengh:update-embed into ff998bd on hexojs:master.

@curbengh curbengh marked this pull request as ready for review July 20, 2020 06:10
@curbengh curbengh merged commit 28cda7f into hexojs:master Jul 21, 2020
@curbengh curbengh deleted the update-embed branch July 21, 2020 03:42
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

Successfully merging this pull request may close these issues.

3 participants