@bobmonsour I wonder if you might be interested in providing an API on https://11tybundle.dev/ (just a JSON file that has titles and URLs) that could be consumed by 11ty.dev for community resources? Happy to give proper attribution to your excellent resource too, maybe a heading that says “Community Resources via 11tybundle.dev”?
I’m working on a CMS docs page for 11ty.dev and I’d love to include the resources on https://11tybundle.dev/categories/cms/
Feel free to say no! 😅
22 replies
@zachleat I’m definitely willing. Ability is another thing. If you could point me in the right direction on how to do this kind of thing, I’d love to. I’ll do some of my own research into it. Do you want the full firehose or the ability to choose by category?
@bobmonsour Whatever is easiest! One big JSON file would be fine as long as it had the category listed in the entries. Here’s an example of what I do on 11ty.dev to expose a JSON API for speedlify.dev: https://github.com/11ty/11ty-website/tree/main/src/api and then I use this URL to consume the entries: https://www.11ty.dev/api/urls.json
@bobmonsour I’d also be happy to contribute the code to do this, if that would be helpful!
@zachleat Thanks . I’m traveling right now, so let me look at this tonight. Should be a fun learning experience.
@bobmonsour no rush at all!
@zachleat For your consumption...a little more data than you want, but the same entries as on the site. Let me know if this works for you. https://11tybundle.dev/api/cms.json
@zachleat Here's how I did it: https://github.com/bobmonsour/11tybundle.dev/blob/main/src/api/cms.11ty.js
@bobmonsour this looks amazing—thank you so much Bob! I’ll work on adding it to 11ty.dev and let you know when it’s up
-
@zachleat That is wonderfully awesome!
@bobmonsour happy to do something similar with other categories if you see a fit on any of the other docs pages too! Just let me know!
@zachleat Great minds…I’ll take a look and let you know.
@zachleat I’m thinking that the Getting Started page might be a good fit. That said, there are 49 posts and some go back to early 2020. You might want to restrict them to early 2023 as that was when 2.0 came out (there are 15 in 2023). Also, I’m delivering these in descending date order now, so you don't have to sort. The Getting Started is available now at https://11tybundle.dev/api/getting-started.json Lastly, I’m thinking of deleting the “Issue" key from these...assuming that you are ignoring it. LMK.
@bobmonsour I don’t think I’ll include the issue in the listing unless you think it might provide value? But I have no problem keeping it in the API output!
This one is shipping to https://www.11ty.dev/docs/getting-started/ now!
@bobmonsour (and thank you! These are very helpful!!)
@zachleat I have to say that it's really cool to see these on the 11ty docs site. Thanks for the idea! The Issue is just the blog post issue where the post showed up (no real value in your use case). It's easier if I just leave it in. More to come with some other categories as time permits.
@zachleat The Getting Started section where you had the 11tbundle.dev posts seems to have disappeared from the site.
@bobmonsour Oops, fix is deploying now! Thank you
@zachleat Let me know if you want to do this with any other categories.
@bobmonsour haha jinx 🏆
-
@zachleat This look really simple. Stay tuned…
@zachleat The posts often have multiple categories. I'll generate the json file for only those posts in the CMS category. The category name will be part of each item along with title and url. I'll include Author too. I'll make the endpoint so that it can be a model for other categories in case you want more later. Given what you've shared, I think I see a clear path forward. I'll let you know when there's something to try. Let me know how that sounds. Glad you said no rush.