Making a GitHub Repository Collection in 11ty
Make a JSON file listing all my GitHub repositories and make a collection out of them.
- Add a script to the package.json file. Replace 'whaleen' with any username.
"gh-repos": "curl https://api.github.com/users/whaleen/repos -o _data/repos.json"
- Create the file in 11ty's _data folder called repos.json.
npm run gh-repos
- Consume the data
---
layout: layouts/base.njk
pagination:
data: repos
size: 1
alias: repo
permalink: repo//index.html
---
!!! this code block is trying to render my curly tags
<h1></h1>
<h2>@</h2>
<p>
</p>
Repo: <a class="h1" href=""></a>
<h3>Clone Repo</h3>
<pre>git clone </pre>
Stargazers |
Watchers |
Language:
resume writing this when i figure that out.