Skip to content

Commit 34837da

Browse files
committed
rebranding
1 parent 5e02b0e commit 34837da

File tree

7 files changed

+63
-16
lines changed

7 files changed

+63
-16
lines changed

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Github Pages Directory Listing
1+
# Custom branded fork of [github-pages-directory-listing](https://github.com/jayanta525/github-pages-directory-listing)
22
[![main](https://github.com/jayanta525/github-pages-directory-listing/actions/workflows/main.yml/badge.svg)](https://github.com/jayanta525/github-pages-directory-listing/actions/workflows/main.yml)
33
[![license](https://img.shields.io/github/license/jayanta525/github-pages-directory-listing)](https://github.com/jayanta525/github-pages-directory-listing/blob/main/LICENSE)
44
[![Paypal Donate](https://img.shields.io/badge/donate-paypal-00457c.svg?logo=paypal&style=plastic)](https://www.paypal.me/jayanta525)
@@ -27,17 +27,17 @@ jobs:
2727
- name: Checkout Repository
2828
uses: actions/checkout@v3
2929
with:
30-
ref: dummy-data #checkout different branch
30+
ref: main #checkout different branch
3131
3232
- name: Generate Directory Listings
33-
uses: jayanta525/github-pages-directory-listing@v3.0.0
33+
uses: steccah/github-pages-directory-listing@v4.0.0
3434
with:
35-
FOLDER: data #directory to generate index
35+
FOLDER: . #directory to generate index
3636
3737
- name: Upload artifact
3838
uses: actions/upload-pages-artifact@v1
3939
with:
40-
path: 'data' # upload generated folder
40+
path: '.' # upload generated folder
4141
4242
deploy:
4343
needs: pages-directory-listing
@@ -78,7 +78,7 @@ jobs:
7878
#### Choosing a folder to generate indexing
7979
```
8080
- name: Generate Directory Listings
81-
uses: jayanta525/github-pages-directory-listing@v2.0.0
81+
uses: steccah/github-pages-directory-listing@v4.0.0
8282
with:
8383
FOLDER: data #directory to generate index
8484
```

src/icons.json

+6
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,12 @@
198198
".md"
199199
]
200200
},
201+
{
202+
"icon": "nt",
203+
"extension": [
204+
".nt"
205+
]
206+
},
201207
{
202208
"icon": "package",
203209
"extension": [

src/icons/nt.svg

+35
Loading

src/main.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@ def main():
4141
"<a class=\"my-auto text-blue-700\" href=\"../\">../</a></th><td>-</td><td>-</td></tr>" if dirname != "." else "",
4242
]))
4343
for subdirname in dirnames:
44-
f.write("<tr class=\"w-1/4 bg-white border-b hover:bg-gray-50\"><th scope=\"row\" class=\" py-2 px-2 lg:px-6 font-medium text-gray-900 whitespace-nowrap flex align-middle\"><img style=\"max-width:23px; margin-right:5px\" src=\"" + get_icon_base64("o.folder") + "\"/>" + "<a class=\"my-auto text-blue-700\" href=\"" + subdirname + "/\">" +
45-
subdirname + "/</a></th><td>-</td><td>-</td></tr>\n")
44+
if subdirname[0] != '.':
45+
f.write("<tr class=\"w-1/4 bg-white border-b hover:bg-gray-50\"><th scope=\"row\" class=\" py-2 px-2 lg:px-6 font-medium text-gray-900 whitespace-nowrap flex align-middle\"><img style=\"max-width:23px; margin-right:5px\" src=\"" + get_icon_base64("o.folder") + "\"/>" + "<a class=\"my-auto text-blue-700\" href=\"" + subdirname + "/\">" +
46+
subdirname + "/</a></th><td>-</td><td>-</td></tr>\n")
4647
for filename in filenames:
47-
path = (dirname == '.' and filename or dirname +
48-
'/' + filename)
49-
f.write("<tr class=\"w-1/4 bg-white border-b hover:bg-gray-50\"><th scope=\"row\" class=\" py-2 px-2 lg:px-6 font-medium text-gray-900 whitespace-nowrap flex align-middle\"><img style=\"max-width:23px; margin-right:5px\" src=\"" + get_icon_base64(filename) + "\"/>" + "<a class=\"my-auto text-blue-700\" href=\"" + filename + "\">" + filename + "</a></th><td>" +
50-
get_file_size(path) + "</td><td>" + get_file_modified_time(path) + "</td></tr>\n")
48+
if filename[0] != '.':
49+
path = (dirname == '.' and filename or dirname +
50+
'/' + filename)
51+
f.write("<tr class=\"w-1/4 bg-white border-b hover:bg-gray-50\"><th scope=\"row\" class=\" py-2 px-2 lg:px-6 font-medium text-gray-900 whitespace-nowrap flex align-middle\"><img style=\"max-width:23px; margin-right:5px\" src=\"" + get_icon_base64(filename) + "\"/>" + "<a class=\"my-auto text-blue-700\" href=\"" + filename + "\">" + filename + "</a></th><td>" +
52+
get_file_size(path) + "</td><td>" + get_file_modified_time(path) + "</td></tr>\n")
5153

5254
f.write("\n".join([
5355
get_template_foot(),
@@ -85,6 +87,7 @@ def get_template_head(foldername):
8587
with open("/src/template/head.html", "r", encoding="utf-8") as file:
8688
head = file.read()
8789
head = head.replace("{{foldername}}", foldername)
90+
head = head.replace("{{nexticon}}", get_icon_base64("icon.nt"))
8891
return head
8992

9093

src/png/nt.png

63.9 KB
Loading

src/template/foot.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
</table>
33
</div>
44
<footer>
5-
<p class="m-2 lg:m-4 text-sm">generated with <a href="https://github.com/jayanta525/github-pages-directory-listing"
6-
target="_blank" class="text-blue-700">github-pages-directory-listing</a></p>
5+
<p class="m-2 lg:m-4 text-sm">Source code: <a href="https://github.com/orgs/next-team-swe/repositories"
6+
target="_blank" class="text-blue-700">Next Team</a></p>
77
</footer>
88
</body>
99

src/template/head.html

+5-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@
88
</head>
99

1010
<body>
11-
<div class="m-2 lg:m-4">
12-
<span class="font-bold tracking-wide text-2xl text-gray-700">Index of {{foldername}}</span>
11+
<div class="flex flex-wrap">
12+
<img class="h-16 m-2" src="{{nexticon}}">
13+
<div class="m-2 lg:m-4 flex">
14+
<span class="font-bold tracking-wide text-2xl text-gray-700 self-end">Index of {{foldername}}</span>
15+
</div>
1316
</div>
1417
<div class="overflow-x-auto relative shadow-md sm:rounded-lg m-2 lg:m-4">
1518
<table class="w-full text-sm text-left text-gray-500">

0 commit comments

Comments
 (0)