Customisable start year

master
trémeur 9 months ago
parent 60f716c3b3
commit 5f11a97bf3

@ -15,6 +15,7 @@ Rename =variables-template.py= to =variables.py= and edit:
- =domain=: =https://yourdomain.tld= without trailing slash - =domain=: =https://yourdomain.tld= without trailing slash
- =rclonesiteroot=: path =rclone= uses to access your webserver - =rclonesiteroot=: path =rclone= uses to access your webserver
- =description=: content for the “about” section (can include HTML tags) - =description=: content for the “about” section (can include HTML tags)
- =startyear=: year from which to begin tracking (an integer)
- =hue=: theme colour expressed as a hue from 0 to 360 - =hue=: theme colour expressed as a hue from 0 to 360
- =consoles=: add or remove consoles following the format provided (=.png= images must be added to the build directory with a filename corresponding with the value of ="img"= for each console) - =consoles=: add or remove consoles following the format provided (=.png= images must be added to the build directory with a filename corresponding with the value of ="img"= for each console)
*** The rest *** The rest

@ -8,7 +8,7 @@ Load in the list of games from a set of .org files.
thisyear = datetime.now().strftime("%Y") thisyear = datetime.now().strftime("%Y")
year = 2016 year = variables.startyear - 1
concernedfiles = [] concernedfiles = []

@ -25,7 +25,7 @@ def history(local=False):
feedwrite.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n <channel>\n <atom:link href=\"" + variables.domain + variables.serverpath + "feed.xml\" rel=\"self\" type=\"application/rss+xml\" />\n <title>Static backlog</title>\n <link>" + variables.domain + variables.serverpath + "backlog</link>\n <description>Feed for gaming updates</description>\n <language>en-gb</language>") feedwrite.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n <channel>\n <atom:link href=\"" + variables.domain + variables.serverpath + "feed.xml\" rel=\"self\" type=\"application/rss+xml\" />\n <title>Static backlog</title>\n <link>" + variables.domain + variables.serverpath + "backlog</link>\n <description>Feed for gaming updates</description>\n <language>en-gb</language>")
theyear = int(gamesort.thisyear) theyear = int(gamesort.thisyear)
while theyear > 2016: while theyear >= variables.startyear:
yearlist = [] yearlist = []
enddate = datetime.strptime((str(theyear) + "-12-31"),"%Y-%m-%d") enddate = datetime.strptime((str(theyear) + "-12-31"),"%Y-%m-%d")
startdate = datetime.strptime((str(theyear) + "-01-01"),"%Y-%m-%d") startdate = datetime.strptime((str(theyear) + "-01-01"),"%Y-%m-%d")

@ -16,6 +16,8 @@ rcloneaddress = ""
description = "" description = ""
startyear =
hue = hue =
consoles = [{"code":"ps5","name":"PlayStation 5","shortname":"PS5","img":"PS5"}, consoles = [{"code":"ps5","name":"PlayStation 5","shortname":"PS5","img":"PS5"},

Loading…
Cancel
Save