I have written a post on hexo.io that outlines how to go about making a hexo tag that gets data from an async file read. Sometimes I might want to write a tag that gets data that is to be used to generate content in a page by way of an async http request.
I am on the fence with this. As of late I like the idea of having separate scripts that can be used to update the actual text of my markdown files, rather than writing a hexo tag. Still I have not yet found, or developed a decent software solution for maintaining a large collection of markdown files. For now it would seem that this approach works okay.
So in the scripts folder of my hexo project working tree I have a *.js file called “my-tags.js” which is where I register all the hexo tags for use in my blog posts. In there I have this code that is relevant to this process.
So I am just registering a hexo tag, the only difference is that it is going to have to be an async tag because of the latency with making the request.
Error getting data :(
Be sure to check out my other posts on hexo