This is the static site generator for Dwelling of Duels.
- Install Python 3
- Ensure that you can run
python
andpip
in your terminal - Download and unzip [the latest release] of this software
- Open a terminal to the unzipped release
- Install python packages:
pip install -r requirements.txt
Edit site.cfg
to configure your build of the site. An example has been
provided for you as site_example.cfg
and must be renamed before use. It has
the following settings:
voting
controls whether or not the site is in voting mode. Valid values areon
andoff
.deadline_date
is the date displayed in the deadline section of the sidebar. It must be a date of the formYYYY-MM-DD
. For example:2016-01-31
.deadline_time
is the time displayed in the deadline section of the sidebar.archive_dir
is the name of the local directory that holds the DoD archive folder. It defaults tododarchive
. You probably don't need to change this.archive_url
is the url of the webhost where thearchive_dir
directory is hosted. In testing, this will belocalhost
, while in production it will probably be something likehttp://dwellingofduels.net
. This should not have a trailing slash.winners_month_override
allows you to force a specific month to appear as the winners block at the top of the page. Only needed if you run two duels at the same time, like we did in Aug 2022 for Free + Dreamcast duels.latest_month_override
changes which duel is considered 'in voting'. This is the duel that gets sliders on its page, as well as being redirected to from the/voting
route and other 'vote now' buttons. Only noticeable ifvoting
is set toon
.
The deadline_*
settings refer to the voting deadline when voting
is set to
on
and the submission deadline when voting
is set to off.
Add artist links to the artist-links.csv
file.
Ensure that the archive_dir
you specified in site.cfg
directory is in the
same directory as build.py
.
To build for deploying to a web server:
python build.py
To build for local testing:
python build.py test
or
Double click on localserver.bat
to build a test site and run a python server.
You will then be able to visit localhost:8000
in your browser and browse the site.
In either of the above scenarios, you will find a deploy
directory containing
the newly-built site.
Edit front-page.md
to add content to the front page of the site under the
banner image. An example has been provided for you as front-page_example.cfg
and
must be renamed before use. This file will be parsed as Markdown when you run
build.py
.
Below are instructions on how to use the site through the different phases of a duel.
- Ensure that all tagged songs and ancillary files (banner image, listening
log, etc) for the duel that just ended are in the
archive_dir
both locally and on the server. - Set
voting
tooff
insite.cfg
. - Edit front page content in
front-page.md
. - Regenerate the site (see Usage section above).
- Create the new duel's directory in
archive_dir
. - Add anonymous MP3s and
banner.jpg
to the new duel's directory. - Set
voting
toon
insite.cfg
. - Regenerate the site (see Usage section above).
- make a script that automatically turns any banner art file into other files: the original art file, a smaller but still 1000x1000 jpg file if the original was larger, a 250x250 jpg with some light compression on it to be embdedded in the mp3s, a jpg version of the original file if it was not already in jpg format.
- cleanup old files that dont get used
- move some scripts like aws_archive_03-09_sync.sh to a scripts folder (maybe not because there is already a scripts folder living above this one)