@baris @bentael helped me out last night. Amongst other things he confirmed that too, that being on the index page results in an empty data.url. He did get me going using the location.href.
I have to say every one on this forum has been super helpful. I intend to make a donation to Nodebb in the near future.
Right you would need to add a Topics.updateRecent(tid, timestamp, callback); call into Topics.create() function so that topics are initialy added to /recent.
Change the following code in Topics.create()
'cid:' + topicData.cid + ':tids',
'cid:' + topicData.cid + ':uid:' + topicData.uid + ':tids'
], timestamp, topicData.tid, next);
lol, everything was working when I replaced: