summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-09-07 14:25:25 +0200
committeremkael <emkael@tlen.pl>2017-09-07 14:25:25 +0200
commit91b4d644cf8064457d5365dc1642ad8ab5f87be3 (patch)
tree5953aa85e47ab5286cda000816c6b43ea8ce6527 /bin
parent5a38d64cddc7cef197b5f7ac63b5fb97a72c80da (diff)
Pre-generating menu content for ranking pages
Diffstat (limited to 'bin')
-rwxr-xr-xbin/build-rankings.sh4
-rwxr-xr-xbin/write-menus.sh7
2 files changed, 7 insertions, 4 deletions
diff --git a/bin/build-rankings.sh b/bin/build-rankings.sh
index 41e182a..c51fa1d 100755
--- a/bin/build-rankings.sh
+++ b/bin/build-rankings.sh
@@ -1,12 +1,10 @@
#!/bin/bash
CONFIG=$1
DIR=$2
-PREV_DATE=""
cat $CONFIG |
jq '.[] | .date, .url, .index, .name' |
xargs -n4 |
while read DATE URL INDEX NAME
do
- python scripts/ranking.py "$NAME" $INDEX $DATE $PREV_DATE > $DIR/$URL
- PREV_DATE=$DATE
+ python scripts/ranking.py "$NAME" $INDEX $DIR/.menu.html $DATE > $DIR/$URL
done
diff --git a/bin/write-menus.sh b/bin/write-menus.sh
index 33ae144..500db52 100755
--- a/bin/write-menus.sh
+++ b/bin/write-menus.sh
@@ -1,4 +1,9 @@
#!/bin/bash
CONFIG_FILE=$1
DIRECTORY=$2
-find $DIRECTORY -name \*.html -exec python scripts/static-menu.py $CONFIG_FILE {} $DIRECTORY \;
+mkdir -p $DIRECTORY/players
+find $DIRECTORY -type d -not -name _\* |
+ while read HTMLDIR
+ do
+ python scripts/generate-static-menu.py $CONFIG_FILE $DIRECTORY $HTMLDIR > $HTMLDIR/.menu.html
+ done