How to make a sitemap.xml for a medium-sized site & edit it with Vim

Revised 21 June 2019

Sorry if you’ve come here because of the title; I’ve had to delete most of what I’d written because it’s no longer correct. It was based on using a site (Online Sitemap Generator) where you can make a large sitemap.xml for free (though you are encouraged to make a small donation).   I’d used it for about a year on and off and was reasonably happy with it, although I did need to edit the files quite extensively, which was the point of the post.

Things have now changed at this site; I get a lot of errors  when I try to make a sitemap.  The resulting file is unreliable so I’m no longer using the site.

I haven’t been able to find another site which offers free sitemaps for more than 500 entries. My book reviews page has almost 600 reviews so that’s no good to me. I’d be willing to pay a reasonable amount occasionally but the charges I’ve found on-line are more than I’m willing to pay on a recurring basis considering I don’t get any income from my reviews.

For the moment my solution for the book reviews page is to keep the last good sitemap I obtained and add new entries by hand. This isn’t a problem as I don’t often write more than one review a week at most.

For WordPress I’ve installed a plugin which provides a sophisticated sitemap.xml system which seems to be working well (google-sitemap-generator.4.1.0).





How to avoid problems with Vim undo & redo

Starting with Vim 7.0 this brilliant editor introduced a more powerful set of commands for Undo and Redo, using an undo tree. Being lazy, I didn’t fully get to grips with this and as a result didn’t really understand what I was doing. At times I accidentally deleted text I’d just writtenjjjk and then couldn’t recover it.

I knew the previous version of my work had to be there but I didn’t know how to get it back. After a time I realised that when things seemed to go wrong the solution was to use ‘g-‘ and ‘g+’ to go hack and forth in the undo tree.  But this was a bit hit & miss.

If you have had a similar experience here are a couple of useful site where things are explained clearly;

The second of these sites has links to a couple of plugins which make life easier. I’m not generally an enthusiast for plugins but I’ve installed Histwin, which seems pretty good; I’ll probably try Undotree as well.

Finally, thanks to a third page I now know why I occasionally deleted work I’d just done and couldn’t recover it. See:

This explains why it happens (pressing Ctrl-u in Insert mode) and provides a way to avoid it.