Tracking things using static site generators
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
trémeur 94ce340e8f Add script for displaying record collection 4 months ago
gamebuild Prepare for adding other trackers 10 months ago
placebuild Add place tracker 10 months ago
recordbuild Add script for displaying record collection 4 months ago
.gitignore Add script for displaying record collection 4 months ago
README.org Add script for displaying record collection 4 months ago
UNLICENSE Standing on the shoulders of giants 1 year ago
backlog.py Prepare for adding other trackers 10 months ago
cardstring.py Prepare for adding other trackers 10 months ago
demo.org Add place tracker 10 months ago
gameskel.py Prepare for adding other trackers 10 months ago
gamesort.py Prepare for adding other trackers 10 months ago
generategames.py Prepare for adding other trackers 10 months ago
generateplaces.py Add script for displaying record collection 4 months ago
generaterecords.py Add script for displaying record collection 4 months ago
history.py Prepare for adding other trackers 10 months ago
init.py Add script for displaying record collection 4 months ago
library.py Corrections 10 months ago
sublibrary.py Prepare for adding other trackers 10 months ago
variables-template.py Add script for displaying record collection 4 months ago

README.org

Trackers

About

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

  • orgparse (install via pip)
  • python3
  • 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

Structure of the .org files

See demo.org for an example.

Setting the variables

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
  • localpath: absolute path to this directory, including trailing slash
  • domain: https://yourdomain.tld without trailing slash
  • rclonesiteroot: path rclone uses to access your webserver

Tracking games with a backloggery clone

Setup

Fonts

Upload the fonts Lato, Titillium Web, and Material Icons to the directory /fonts on your server (I recommend google-webfonts-helper). Check the filenames are consistent with those in gamebuild/backloggery.css. Alternatively, you can load the fonts remotely and adjust the page head HTML generated by gameskel.py.

Setting the variables

In variables.py, edit:

  • trackgames: set to True
  • gameserverpath: path to directory on the server where files will be uploaded, including trailing slash
  • endlessgames: a list of “endless” games in the format title (console)
  • description: content for the “about” section (can include HTML tags)
  • gamestartyear: year from which to begin tracking (an integer)
  • gamehue: 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)

Testing

  • Run python3 generategames.py local to build in gamebuild.

Tracking places visited using Leaflet

Setup

Upload a CSS file to the server if necessary. Most CSS is set by Leaflet.

Setting the variables

In variables.py, edit:

  • trackplaces: set to True
  • placeserverpath: path to directory on the server where files will be uploaded, including trailing slash
  • placestartyear: year from which to begin tracking (an integer)
  • placecss: location of the CSS file you wish to apply, relative to the site root

Testing

  • 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).

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 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)

  • Run python3 init.py and then chmod +x build.sh.
  • Create directories on the server corresponding to any *serverpath variables you have set.

Building

  • Run ./build.sh to build and upload to the server.