Add S3 static page generator for bucket browsing
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Implement Python-based generator that creates static HTML index pages for browsing S3 bucket contents. The generator produces nginx-style directory listings with hierarchical navigation.
This commit is contained in:
commit
459388fe60
6 changed files with 687 additions and 0 deletions
53
templates/index_template.html
Normal file
53
templates/index_template.html
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="me" href="https://floss.social/@happyDomain">
|
||||
<title>Index of {{ current_path }} - happyDomain downloads</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: monospace;
|
||||
margin: 2em;
|
||||
background: #fff;
|
||||
color: #000;
|
||||
}
|
||||
h1 {
|
||||
font-size: 1.2em;
|
||||
font-weight: normal;
|
||||
}
|
||||
hr {
|
||||
border: 0;
|
||||
border-top: 1px solid #aaa;
|
||||
margin: 1em 0;
|
||||
}
|
||||
pre {
|
||||
line-height: 1.6;
|
||||
margin: 0;
|
||||
}
|
||||
a {
|
||||
color: #0066cc;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
address {
|
||||
font-style: normal;
|
||||
font-size: 0.9em;
|
||||
color: #666;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Index of {{ current_path }}</h1>
|
||||
<hr>
|
||||
<pre>{% if parent_link %}<a href="../">../</a> -
|
||||
{% endif %}{% for dir in directories %}<a href="{{ dir.name }}/">{{ dir.name }}/</a>{{ ' ' * (50 - dir.name|length) }}{{ dir.last_modified }} -
|
||||
{% endfor %}{% for file in files %}<a href="{{ file.url }}">{{ file.name }}</a>{{ ' ' * (51 - file.name|length) }}{{ file.last_modified }}{{ ' ' * (20 - file.size|length) }}{{ file.size }}
|
||||
{% endfor %}</pre>
|
||||
<hr>
|
||||
<address>Generated by happyDomain static index generator</address>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue