Skip to content

Commit

Permalink
Setup automatic processing
Browse files Browse the repository at this point in the history
  • Loading branch information
Chase22 committed Dec 10, 2024
1 parent c047e41 commit 058c925
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 14 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ jobs:
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5

- name: Generate pages
env:
PAGES: ${{ secrets.PAGES }}
run: |
echo $PAGES > pages
python3 generate-html.py
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
secrets.txt
14 changes: 0 additions & 14 deletions 882nd.html

This file was deleted.

9 changes: 9 additions & 0 deletions generate-html.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
file = open("pages", "r")
template = open("template.html", "r").read()

for project in file.readlines():
(name, url) = map(str.strip,project.split(" "))

open(f"{name}.html", "w").write(
template.replace("%name%", name).replace("%url%", url)
)
13 changes: 13 additions & 0 deletions template.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<script>
window.location.replace("%url%")
</script>
</head>
<body>
<p>
If you are not being redirected to %name% click <a href="%url%">here</a>
</p>
</body>
</html>

0 comments on commit 058c925

Please sign in to comment.