Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Its-Just-Nans committed Jan 3, 2024
0 parents commit a2fb88f
Show file tree
Hide file tree
Showing 199 changed files with 15,773 additions and 0 deletions.
116 changes: 116 additions & 0 deletions .github/workflows/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
""" builder """
from string import Template
import os
from os.path import getmtime, getsize, join
from datetime import datetime


def size(size_in_bytes):
"""convert"""
size_kb = size_in_bytes / 1024.0
size_mb = size_kb / 1024.0

if size_mb >= 1:
return f"{size_mb:.2f}M"
elif size_kb >= 1:
return f"{size_kb:.2f}K"
return size_in_bytes


PATH_TO_TEMPLATE = ".github/workflows/index.html"
with open(PATH_TO_TEMPLATE, "r", encoding="utf-8") as template_file:
html = template_file.read()

EXCLUDE_LIST = [".git", ".github", ".static"]
EXCLUDE_LIST_FULL = ["./README.md", "./.gitignore"]

CSS = """.thumbnail {
position: relative;
z-index: 0;
}
.thumbnail:hover {
background-color: transparent;
z-index: 50;
}
.thumbnail span {
position: absolute;
padding: 5px;
left: -1000px;
border: 1px dashed gray;
visibility: hidden;
color: black;
text-decoration: none;
}
.thumbnail span img {
border-width: 0;
padding: 2px;
min-width: 500px;
}
.thumbnail:hover span {
visibility: visible;
top: 0;
left: 60px; /*position where enlarged image should offset horizontally */
}"""

HEADER = """
"""

html = html.replace("<style></style>", f"{HEADER}<style>{CSS}</style>")

t = Template(
"""<tr>
<td valign="top"><img src="$url" alt="[ ]" /></td>
<td><a $add href="$file">$file $other</a></td>
<td align="right">$date</td>
<td align="right">$size</td>
<td>&nbsp;</td>
</tr>"""
)

URL = "https://bel-art.github.io/telecom-logos"
REPO = "https://github.com/Bel-Art/telecom-logos"
LINK = f'<a href="{REPO}">{REPO}</a>'

UNKNOWN = f"{URL}/.static/unknown.gif"
FOLDER = f"{URL}/.static/folder.gif"


def create_index_html(folder):
"""create an index.html"""
listed = sorted(os.listdir(folder))
s = ""
correct_html = f"{html}".replace(
"<title></title>", f"<title>Index of {folder}</title>"
)
correct_html = correct_html.replace(
"<h1></h1>",
f"<h1>Index of {folder} - {LINK}</h1>",
)
for name in listed:
if name == "index.html" or name in EXCLUDE_LIST:
continue
p = join(folder, name)
if p in EXCLUDE_LIST_FULL:
continue
isdir = os.path.isdir(p)
date = datetime.fromtimestamp(getmtime(p)).strftime("%Y-%m-%d %H:%M:%S")
url = FOLDER if isdir else UNKNOWN
preview = not isdir and not name.endswith(".md")
add = 'class="thumbnail"' if preview else ""
other = f'<span><img src="{name}"></span>' if preview else ""
s += t.substitute(
file=name, date=date, size=size(getsize(p)), url=url, add=add, other=other
)
if isdir and name not in EXCLUDE_LIST:
create_index_html(p)
file_data = correct_html.replace("<placeholder></placeholder>", s)
with open(join(folder, "index.html"), "w", encoding="utf-8") as file:
file.write(file_data)


if __name__ == "__main__":
create_index_html(".")
44 changes: 44 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v4
- name: render index.html
run: python3 .github/workflows/build.py
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: "."
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3
38 changes: 38 additions & 0 deletions .github/workflows/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
<style></style>
</head>
<body>
<h1></h1>
<table>
<tr>
<th valign="top">
<img src="https://bel-art.github.io/telecom-logos/.static/folder.gif" alt="[ICO]" />
</th>
<th><a href="?C=N;O=D">Name</a></th>
<th><a href="?C=M;O=A">Last modified</a></th>
<th><a href="?C=S;O=A">Size</a></th>
<th><a href="?C=D;O=A">Description</a></th>
</tr>
<tr>
<th colspan="5"><hr /></th>
</tr>
<tr>
<td valign="top">
<img src="https://bel-art.github.io/telecom-logos/.static/back.gif" alt="[PARENTDIR]" />
</td>
<td><a href="..">Parent Directory</a></td>
<td>&nbsp;</td>
<td align="right">-</td>
<td>&nbsp;</td>
</tr>
<placeholder></placeholder>
<tr>
<th colspan="5"><hr /></th>
</tr>
</table>
</body>
</html>
13 changes: 13 additions & 0 deletions .github/workflows/reset_history.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# useful to reset history when it's too big
# the git history in this context is not very important

rm -rf .git

git init
git add .
git commit -m "Initial commit"

git remote add origin [email protected]:Bel-Art/telecom-logos.git
git push -u --force origin main
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
index.html
!.github/workflows/index.html
Binary file added .static/back.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .static/folder.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .static/unknown.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BDA/BDA.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BDA/old/BDAC.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BDA/old/BDA_old.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BDA/old/BDA_transparent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BDE/BDE.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BDE/logo_campagne_bde/2011_logo_bde_bedandms.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BDE/logo_campagne_bde/2013_logo_bde_bedzoum.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BDE/logo_campagne_bde/2017_logo_bde_bedpool.jpg
Binary file added BDE/logo_campagne_bde/2018_logo_bde_gastbed.png
Binary file added BDE/logo_campagne_bde/2018_logo_bde_kgbed.jpg
Binary file added BDE/logo_campagne_bde/2019_logo_bde_openbed.png
Binary file added BDE/logo_campagne_bde/2021_logo_bde_bedalive.jpg
Binary file added BDE/logo_campagne_bde/2022_logo_bde_bedia.png
Binary file added BDE/logo_campagne_bde/2023_logo_bde_flambed.png
Binary file added BDE/logo_campagne_bde/2023_logo_bde_scarabed.png
Binary file added BDI/BDI_transparent.png
Binary file added BDI/bdi.jpg
Binary file added BDI/bdi.xcf
Binary file not shown.
Binary file added BDS/BDS.png
Binary file added BDS/logo-tete.png
Binary file added BDS/logo_campagne_bds/2022_HomoSporticus.jpg
Binary file added BDS/logo_campagne_bds/2022_Sportiates.png
Binary file added BDS/logo_campagne_bds/2023_SporToutatis.jpg
Binary file added Bar/Bar.png
Binary file added Bar/babar-blanc.jpg
Binary file added Bar/babar.png
Binary file added Bar/babar_bar.png
Binary file added Bar/babar_contour.png
1 change: 1 addition & 0 deletions Bar/babar_contour.svg
Loading

0 comments on commit a2fb88f

Please sign in to comment.