Open brismuth opened 3 years ago
Thanks for that , fixed my issue commenting the whole line
On my exported medium posts, my draft has the prefix "draft" in the filename, so I add a new condition when checking file will ignore or not.
if !strings.HasSuffix(f.Name(), ".html") || f.IsDir() || strings.HasPrefix(f.Name(), "draft") {
fmt.Printf("Ignoring (ext) %s\n", f.Name())
continue
}
I also change the selector for checking it is a comment or not.
//Medium treats comments/replies as posts
p.IsComment = doc.Find("p[class='graf graf--p graf--leading graf--trailing']").Length() > 0
I see this class in every my comment .html
Based on @nardiyansah solution, I have some comments without the graf-traling class so what's worked for me is
p.IsComment = doc.Find(".graf.graf--p.graf--leading").Length() > 0
@sylwit's solution worked for me as well!
I fixed this issue by forking the repository and commenting out line 137. If you're interested in just building my solution, download https://github.com/rtenacity/medium-to-hugo and build it from there.
I'm trying to use the tool on a medium export I just made, and it's only converting drafts, and not comments.
Here's the command I'm using:
~/path/to/mediumtohugo/macos/mediumtohugo /path/to/medium-export/posts/ /path/to/dest posts
It outputs messages like this for everything that isn't a draft:
Looks like line 137 in main.go might be to blame?
All of my posts (not just comments) contain these lines: