iChris
iChris

Any Eleventy (or JSON?) nerds help a newb out one last time? I want to create a JSON file off my Eleventy based blog including the full content of every post on my site to use as an import. Here’s what I have so far.

|
Embed
Progress spinner
rknightuk
rknightuk

@iChris This is how I'm doing the JSON feed for my site, should point you in the right direction (just noticed I'm using the excerpt instead of the full content but that's easy to switch).

|
Embed
Progress spinner
In reply to
iChris
iChris

@rknightuk Oh that looks perfect. Do you use that just to display it on your microblog or would that be appropriate for if I wanted to import it permanently into my microblog account? (i.e. my current 11ty blog will be replaced with Microblog)

|
Embed
Progress spinner
rknightuk
rknightuk

@iChris I mostly use it for API access to my blog posts for various boring reasons but it should work for displaying in Micro.blog. For importing I'd recommend just importing the markdown files if you have them, I don't think MB supports JSON file import from what I can see.

|
Embed
Progress spinner
iChris
iChris

@rknightuk Ah ok that's what I was thinking I should do - but I can't figure out how to get the permalink into the frontmatter of the markdown files? i.e. this is my post template. (Do you use Eleventy as well?)

|
Embed
Progress spinner
rknightuk
rknightuk

@iChris Apologies, I missed this reply somehow. The way I had to do it for another project was write a script to write the Markdown files and add the permalink to them.

|
Embed
Progress spinner
iChris
iChris

@rknightuk Any chance that's shareable? Or I guess it probably doesn't work because it's different platforms (or whatever the right word is).

|
Embed
Progress spinner
rknightuk
rknightuk

@iChris Yeah it was a completely custom script for moving from a custom CMS to MB so it's not useful for anyone else sadly.

|
Embed
Progress spinner