{"id":22900542,"url":"https://github.com/rioastamal/shdir-listing","last_synced_at":"2025-04-15T04:17:10.818Z","repository":{"id":145535316,"uuid":"381251974","full_name":"rioastamal/shdir-listing","owner":"rioastamal","description":"Bash script to generate directory listing to be displayed on a web server.","archived":false,"fork":false,"pushed_at":"2024-06-13T03:10:16.000Z","size":10,"stargazers_count":5,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T04:17:05.523Z","etag":null,"topics":["bash","html","jamstack","shell-script","static-site","web-server"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rioastamal.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-29T05:41:55.000Z","updated_at":"2024-09-05T09:27:07.000Z","dependencies_parsed_at":"2025-02-07T03:36:49.327Z","dependency_job_id":null,"html_url":"https://github.com/rioastamal/shdir-listing","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rioastamal%2Fshdir-listing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rioastamal%2Fshdir-listing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rioastamal%2Fshdir-listing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rioastamal%2Fshdir-listing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rioastamal","download_url":"https://codeload.github.com/rioastamal/shdir-listing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249003972,"owners_count":21196793,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","html","jamstack","shell-script","static-site","web-server"],"created_at":"2024-12-14T01:28:45.529Z","updated_at":"2025-04-15T04:17:10.793Z","avatar_url":"https://github.com/rioastamal.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"## About shDirListing\n\nshDirListing is Bash script to generate directory listing in HTML format so it can be read by web server. It will create an index.html file in each directory based on specified depth.\n\nI create this tool because object storage services used for static web hosting such as S3 or Netlify does not support directory listing out-of-the box. So I need a quick way to list of files under a directory on those services.\n\n## Requirements\n\n- Unix or Unix like based OS such as macOS or Linux. (Windows should work under WSL)\n- Bash version \u003e= 3.2.57\n\n## Installation\n\nMethod 1 - The easiest.\n\nJust copy and paste the contents of shdir-listing.sh and run it on your local machine.\n\nMethod 2 - Clone the project repository from GitHub.\n\n```\n$ git clone git@github.com:rioastamal/shdir-listing.git\n```\n\nMethod 3 - Download the zipped version from GitHub.\n\n```\n$ curl -O -L 'https://github.com/rioastamal/shdir-listing/archive/master.zip'\n```\n\nAnd then extract to your desired directory.\n\n## Usage and Examples\n\nRunning shDirListing with `-h` flag will give you list of options and example.\n\n```\n$ bash ./shdir-listing.sh -h\n```\n\n```\nUsage: shdir-listing.sh [OPTIONS] DIRNAME\n\nWhere OPTIONS:\n  -d DEPTH      Specify the depth directory under DIRNAME.\n  -e            Generate empty content for index.html. It will prevent\n                directory listing.\n  -h            Show this help and exit.\n  -k            Skip creation of index.html if file named index.html already\n                exists in a directory.\n  -r            Dry run mode. Print the content that will be written to\n                index.html for each directory.\n  -v            Display shDirListing version.\n\n------------------------------------------\n                  EXAMPLE\n------------------------------------------\n\nSuppose you have following directories:\n\n- website/\n  - docs1/\n    - archives/\n  - docs2/\n  - images/\n\nAnd run this command to generate directory listing.\n\n$ bash ./shdir-listing.sh -d 2 ~/website\n\nIt will create index.html file with maximum depth of\n2 directories under website/. And here is the result.\n\n- website/\n  - docs1/\n    - archives/\n      - index.html\n    - index.html\n  - docs2/\n    - index.html\n  - images/\n    - index.html\n  - index.html\n\n----------------------------- About shDirListing -----------------------------\n\nshDirListing is Bash script to generate directory listing in HTML format to be\nused in web server. It will create an index.html file in each directory.\n\nshDirListing is free software licensed under MIT. Visit the project homepage\nat https://github.com/rioastamal/shdir-listing\n```\n\n### Create Directory Listing for 0 Level Deep\n\nBy default the depth directory is `0` zero. Given directory below:\n\n```\n- website/\n  - docs1/\n    - archives/\n  - docs2/\n  - images/\n```\n\n```\n$ bash ./shdir-listing ~/website\n```\n\nIt will generate directory listing for `website/index.html` only.\n\n### Create Directory Listing for 1 Level Deep\n\nGiven directory below:\n\n```\n- website/\n  - docs1/\n    - archives/\n  - docs2/\n  - images/\n```\n\n```\n$ bash ./shdir-listing -d 1 ~/website\n```\n\nIt will generate directory listing below.\n\n```\n- website/\n  - docs1/\n    - index.html\n    - archives/\n  - docs2/\n    - index.html\n  - images/\n    - index.html\n  - index.html\n```\n\n### Running in Dry Run mode.\n\nIn Dry Run mode no file will be written. So you can make sure that all the action are correct before running the real one. Taken from previous example add an option switch `-r`.\n\n```\n$ bash ./shdir-listing -d 1 -r ~/website\n```\n\n```\n[DRY RUN] Creating index.html for /website/docs1...DONE.\n[DRY RUN] Creating index.html for /website/docs2...DONE.\n[DRY RUN] Creating index.html for /website/images...DONE.\n[DRY RUN] Creating index.html for /website...DONE.\n```\n\n## Author\n\nshDirListing is written by Rio Astamal \u0026lt;rio@rioastamal.net\u0026gt;\n\n## License\n\nshDirListing is open source licensed under [MIT license](http://opensource.org/licenses/MIT).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frioastamal%2Fshdir-listing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frioastamal%2Fshdir-listing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frioastamal%2Fshdir-listing/lists"}