How to Enable Directory Indexing on GitHub Pages

前端 未结 4 1260
臣服心动
臣服心动 2021-02-04 05:55

I need to display directory contents on GH Pages.

Would prefer

  1. Automatically, without index.html
  2. A tool or library for automatically generating t
4条回答
  •  野的像风
    2021-02-04 06:30

    If you want a dynamic index that doesn't require any updating the only method I've found is by generating it client side with the github contents api.

    Here is a simple example that creates links to files in the top level directory of your project. If you want to support subdirectories using this method you would have to recursively request the contents of each folder.

    
      
        
      
    
    

    Here's an example where I used this to create a simple directory for a flat repo I have.

提交回复
热议问题