Create a collection of "developers" and add GitHub infos to them #1857
-
Hallo! But first things first: The test project can be found here I start with a fresh 11ty install. I created a collection subfolder called /developers with an developers.json in it with this content:
Than I add another file called holger1411.md (<- yep, thats me...) with this content:
Than I installed node-fetch as dev dependency. After it I add a /_data folder to the root directory and add the following to it:
I use this to fetch some basic infos for my GitHub profile and prepare that data to be available globally. Okay and than I add a template file called "developer.njk" to the /_includes/layout folder.
And tatatata....it works. It shows my Github profil name, my follower count, my twitter profile handle and my avatar image... So far so good...but now I want to add another developer to the collection. For example a file called zachleat.md with this content:
Of course this will render my information instead of zachleat ´s... I´am "just" a UX Designer with limited JS and API knowledge, but I can "smell" already that there is a easy solution near by... Big thx upfront! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
I can think of two possible solutions:
Both solutions have some pros and cons, but guaranteed that you’ll learn something with each approach. |
Beta Was this translation helpful? Give feedback.
I can think of two possible solutions:
img
andp
tag output.Both solutions have some pros and cons, but guaranteed that you’ll learn something with each approach.