Hi. I’m trying to import existing Hugo blog posts, and the images are not being pulled from the original site as ℹ️ Markdown import implies they should be.
The relevant bit of the .md file is:
{{< figure src=“/ox-hugo/tni2.jpg” caption=“<span class="figure-number">Figure 1: "This Phone Is Property of Ohio Bell" by George Jones is licensed under CC BY 2.0” width=“200px” >}}
I put the domain name (curious.galthub.com) in the upload box below name of zip file, but the image is not pulled in. No relevant errors in the log. The post does get created.
Sorry, the import of images only works with plain <img> tags currently, not figure. We have to parse the HTML during import before Hugo processes anything, so the short codes are skipped.
This is something we could improve in the future. For now, you’d need to convert the Markdown to use img tags, or manually upload the images and update the references.
I could get them all in with a quick hack/edit/series of tags, but I’m still left having to manually map the randomized filenames back to original names.
There’s no multiple upload from the web. If you’re on macOS, you can drag up to 10 images at a time from the Finder to the Uploads screen.
When uploading a bunch of photos, a script that uses the API is a good way to go. I wrote a script in Ruby to do this when I migrated my podcast to Micro.blog, to batch upload all the MP3s: timetable_import.rb · GitHub
For those who are using macOS there’s this shortcut I’ve started using made by an mb user. It works great. I add it to my menubar. Just note that it pulls from Photos so you’ll need to save them there for it to be easy.