This is an example of an automatic directory browser I created for personal use. Uses GitHub’s REST API. This repo is the one I used for my Coding Dojo class assignments and projects when I first started in 2023.
Why did I create this?
So I was using a single repo for all my projects regarding this class which I preferred in this case. Since there are many different nested folders, I wanted an easier automated way to list directories so that anyone can easily browse to an active html folder. I know this is not how GitHub is used but was very fun making this happen and render.
Since I have no access to the back-end of my own repositories or pages, I do however have access to the API which show a lot of cool info about your repositories. Using this I made a custom script within the HTML that grabs the specific repo’s folder/file list from the REST API and recreates them in an html ul li anchor tag format.
Some internal CSS and JavaScript was used to keep it as a single file and give icons to files and folders.
To Do:
Add a little more CSS to make it look nicer.
Add some more error checking.