copy posts from wordpress.com to github pages
so i want to create ferryzhou.github.io with my programming only posts on ferryzhou.wordpress.com
started with a git repo
first use github codespace + copilot
code is here: https://github.com/ferryzhou/wp2gh#
initially the generated code try to use rest api but it does not work
then i just export my wordpress content
ask copilot to write a function to read xml instead
this is much faster and data looks good
also setup https://github.com/ferryzhou/ferryzhou.github.io
ask copilot to enable create pull requests
code is good
made multiple edits
the main bug is markdownify somehow strip whitespaces of the original content and it made results ugly
fixed the bug by just remove the markdownify md processing step
the other issue is that when setup ferryzhou.github.io, i forgot to start with a template
have to copy and commit
here’s results: https://ferryzhou.github.io/
pretty god
Another good thing is that I can run the code again and again, update all articles, without worry about duplication. as the each post will always has the same file name.
lastly, each update is a pull request, so I can inspect changes first.
the whole project took about several hours.
didn’t manually write too much code, mostly vibe coding.
the key is to quickly iterate, verify and find the right path.