Static blog (11ty) to my server

After solving (so far) the FTP problem, I finally moved a test small sample of my static log file, created by 11ty to my server and it didn’t work! The problem was not using relative addressing. Or am I missing something? It seems…for a static site generator, that I should be able to simply move the files to my server and it would work. I do seem to remember reading someone’s tutorial about having to fix link addresses. Surely I’m missing something…maybe a switch? Unless 11ty is only designed to work with netlify? All the other tutorials I read seemed to use that method.

Anyhoo I wrote a python program to fix the hrefs in the main index.html. In hind site I could have simply used a text editor to change ‘href=”/posts/…’ to ‘href=”posts/…’ but at the time I thought I would have the program do more. After which…it worked. Isn’t pretty (that can be worked on), but it worked! Web design isn’t my thing but I did add some borders/white space. And here it is, maybe a few small fixes needed. No PHP…no SQL. Just static site goodness. I think I said it before but I’ll say it again, I find the fact that 11ty reads the date/time in the front matter, and sorts the index correctly (newest entries at top) very cool. Some entries such as Star Trek also include images! Today I’m approaching 500 WordPress posts and wouldn’t want to recopy everything, every time I made a change or new entry, so I can use Filezilla’s copy options to not rewrite existing entries.

So to recap, steps to create Static Site from WordPress.

  • Use WordPress export to create xml and save locally.
  • Run the blog2md-master utility to convert local xml to markdown.
  • Run my Python 3 program fixMD to change Hugo front matter to 11ty front matter.
  • Move markdown files to 11ty posts sub directory.
  • Run “npx eleventy” to create static site.
  • Fix article links in index.html to use relative addressing.
  • Move files in ‘_site’ to my website blog sub directory.