The scripts in this repository take information from a structured set of =.org= files and use them to build static webpages that track various activities (so far, gaming and travelling). These pages can be used as a replacement for third-party services e.g. Backloggery.
The scripts in this repository build static webpages based on information from two sources:
- a structured set of =.org= files;
- APIs of selected third-party websites (so far: Discogs).
These pages can be used as a replacement for third-party services e.g. Backloggery.
* Dependencies
* Dependencies
- =geopy= if you are tracking places visited (install via pip)
- =orgparse= (install via pip)
- =orgparse= (install via pip)
- =python3=
- =python3=
- =rclone= (for syncing to the server)
- =rclone= (for syncing to the server)
- =geopy= if you are tracking places visited (install via pip)
- =python3-discogs-client= if you are displaying a record collection (install via pip)
* General setup
* General setup
** Structure of the .org files
** Structure of the .org files
See =demo.org= for an example.
See =demo.org= for an example.
** Setting the variables
** Setting the variables
Rename=variables-template.py= to =variables.py= and edit:
Copy=variables-template.py= to =variables.py= and edit:
- =orgpath=: absolute path to the root directory in which =.org= files are stored, including trailing slash
- =orgpath=: absolute path to the root directory in which =.org= files are stored, including trailing slash
- =localpath=: absolute path to this directory, including trailing slash
- =localpath=: absolute path to this directory, including trailing slash
- =domain=: =https://yourdomain.tld= without trailing slash
- =domain=: =https://yourdomain.tld= without trailing slash
@ -43,6 +47,19 @@ In =variables.py=, edit:
** Testing
** Testing
- Run =python3 generateplaces.py local= to build in =placebuild=. (This may take some time.)
- Run =python3 generateplaces.py local= to build in =placebuild=. (This may take some time.)
- Check whether places are displayed accurately in the output file. If not, add regions/countries to disambiguate any incorrectly displayed places to the =disambig= dictionary in =variables.py= (see examples).
- Check whether places are displayed accurately in the output file. If not, add regions/countries to disambiguate any incorrectly displayed places to the =disambig= dictionary in =variables.py= (see examples).
* Displaying a record collection (taking data from Discogs)
** Setup
- Upload a CSS file to the server for styling fonts etc; most CSS is set inline.
- Get a Discogs API token [[https://www.discogs.com/settings/developers][here]].
*** Setting the variables
In =variables.py=, edit:
- =trackrecords=: set to =True=
- =recordserverpath=: path to directory on the server where files will be uploaded, including trailing slash
- =recordcss=: location of the CSS file you wish to apply, relative to the site root
- =discogstoken=: the API token you generated
- =discogsuser=: your Discogs username
** Testing
- Run =python3 generaterecords.py local= to build in =recordbuild=.
* First run (or if adding any new trackers)
* First run (or if adding any new trackers)
- Run =python3 init.py= and then =chmod +x build.sh=.
- Run =python3 init.py= and then =chmod +x build.sh=.
- Create directories on the server corresponding to any =*serverpath= variables you have set.
- Create directories on the server corresponding to any =*serverpath= variables you have set.
writefile.write(" </main>\n <p>Generic disc icons by <a href=\"https://www.flaticon.com/free-icon/cd_5344201\">popo2021</a> and <a href=\"https://www.flaticon.com/free-icon/disc_5613845\">Dinosoft Labs</a> on Flaticon.<p>\n </body>\n</html>\n")