I’m wondering how you would go about injecting a frontmatter variable, My post for example into an SVG image, and then. convert it to JPG. I’ve kind of mapped out a process but would love your thoughts, perhaps there is an easier way.
Build Hugo
Output all posts as JSON.
Use node to traverse the file and pick out posts & variables I need (I think thats how it would work)
Use sharp to convert the title into an SVG and save as a JPG.
So, if I am understanding correctly, you want a frontmatter string to be used as a opengraph image?
You should be able to overlay text on to an image (which can be a blank) using image.text
@bep that is some clever stuff.
Just to confirm, you’re not using an SVG but layering over some text with a particular font using a filter?Wasn’t aware you could do that. Thanks!
Either place it the assets directory, or mount the static directory on the assets directory by including both of the following in your site configuration: