-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
Exporting Thumbnails #50
Comments
Hello Reinaldo! I did find a bug related to this. Just pushed a fix. Please try again with v2.0.5. |
It works Will. Thank you |
Awesome. I also meant to ask about the custom post types thing... Would you be comfortable sending me your export file (if it doesn't have private/sensitive data in it) and the name of the custom post type(s) you're trying to get? That would be helpful for me to test and add that feature. |
Sure!
Try to download it from my Google Drive.
https://drive.google.com/drive/folders/1rtCb0W54zFuzx3iWCmRECF7bLEEk1k3T?usp=sharing
I'm using a WordPress plugin (q-translate) to translate posts and custom
posts on my WordPress website and I would like to remove the translation
from all posts when exporting to markdown. I believe it can be done using
some regex to eliminate the text between language tags (es. [:en] my
english text here), is it possible?
Feel free to take a look in the website:
file.org.br
The home page contains all custom post types (highlight) with a metadata
point to another custom post type page (es. books, FILE PAI, Hypersonica
2019).
…On Fri, Dec 25, 2020 at 8:16 PM Will Boyd ***@***.***> wrote:
Awesome.
I also meant to ask about the custom post types thing... Would you be
comfortable sending me your export file (if it doesn't have
private/sensitive data in it) and the name of the custom post type(s)
you're trying to get? That would be helpful for me to test and add that
feature.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#50 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABVGIO7OXSUQKFFBKURCRLSWTQHZANCNFSM4VAM72KA>
.
|
@rfos thank you! There's so much data there haha, excellent help for testing. I created a branch that can parse out multiple post types: https://github.com/lonekorean/wordpress-export-to-markdown/tree/multiple-post-types So basically...
The output should be all the posts of the post types you asked for, organized into folders. I'll probably merge this to master soon, but if you had any feedback I'd love to hear it. |
Alright, I pushed another commit to that branch that changes how it works. It is now a question in the wizard ("Include custom post types and pages?") and will automatically find all custom post types. I try not to add more questions to the wizard to keep things simple, but this feature might be worth it. It seems to work well, but I am not 100% sure that people would not prefer listing the post types they want manually. Also, your export file is so huge, I had to increase the amount of memory node can use. 😄
|
Thank you @lonekorean I started testing that new version and I'm having some troubles while it's saving the images (around 7/8.000), I don't know what is happening but it just stops running. Probably because there are too many images to download. I'm exporting the WordPress content to HUGO and saving images inside the same folder for each post can be a problem because Hugo considers images inside the To adapt your code I added the type to the markdown file: parses.js
Great job! |
Hey @rfos, so I've been working on things. I updated the markdown parser this script uses, so it's more efficient, now I'm able to parse your entire export file without bumping up node's memory. I found some encoding issues with downloading your images, and was able to adjust the script to work better for them. So now I'm able to get all but 132 of the images. The remaining images may be unused/removed images, not sure. I also updated the script so that it will not try to save/download things that have already been saved/downloaded. Basically this means you can rerun the script to pick up where you left off. Useful if your internet connection dropped, computer crashed, etc. It sounds like maybe you've figured out how to get images in a way that works with HUGO. If not, let me know, maybe I can figure something out. I've been setting "Create a folder for each post?" to "no", which sounds closer to what you want. Thanks again, your data has been very helpful, and also I understand if you've moved on, totally fine. :) |
@lonekorean you're the best. |
I think it works like a magic, there are so many images that were "unavailable" before your last commit, now it seems to be ok. |
I experimented with a way to split the languages apart in another branch: https://github.com/lonekorean/wordpress-export-to-markdown/compare/file-lang-split It flows like this:
I'm not sure exactly how you wanted the output to be shaped, but maybe that's one approach you could work with. Also this code is VERY hacky and makes some assumptions. 😁 Your problem seems to be very specific, so I was not intending to merge and publish this code. |
Yes, it's very specific but a lot of WordPress website is using that plugin to publish the content in multiple languages, the big problem is that plugin have no more updates witch create some problems with the new visual editor inside WordPress, maybe it can be an alternative when someone wants to leave WordPress and start with static sites.
My idea is to create the same content in both languages but not necessarily for all content published, some articles can be published only in Portuguese others only in English.
I really appreciate your dedication in writing a code for my case, thank you so much. I just test it and it works perfectly.
I going to start a new template and I'll share it with you in case you are curious to see the final result. :-)
Thank you again and Happy New Year.
|
I'm going to go ahead and close this since the original issue is resolved. Thank you for sharing your data with me and working with me! I look forward to seeing the final result. 🙂 |
Hi Will,
That plugin is amazing, thank you so much for sharing it.
I'm trying export custom type posts from WordPress but I'm unable to export thumbnails from custom posts types, also exporting normal "posts" doesn't export the image thumbnail.
I had a local environment from wordpress running and I'm exporting the xml directly from Wordpress to each custom post types, from each individual file I can generate the .md files but non of my custom posts is getting the thumbnail.
Please if you have any suggestions let me know
Thank you again.
The text was updated successfully, but these errors were encountered: