-
Notifications
You must be signed in to change notification settings - Fork 41
Add ons
The website currently provides two sections of add-ons (the current version of Kodi and one version back). During beta for the next version of Kodi, that one is also added. The add-on section of the website for each Kodi version is created based on the addons.xml
file for that version and is downloaded from the mirrors each time the site is built. A custom Gatsby plugin parses the addons.xml
file and downloads images for any new/updated add-ons so that other Gatsby functions can build all the pages.
There are many pieces that work together to create the add-on section of the web site. This section provides an overview of that pieces. A section further down describes in detail how to setup a new section for a new version of Kodi.
The plugin was written, in theory, to be called multiple times with different settings, but current testing has shown that configuration doesn't work properly. Given that Each version of Kodi requires a separate copy of the plugin tagged with the version name at the end. (So gatsby-source-kodiaddon-matrix
for the Matrix add-ons). The plugin downloads a copy of the addons.xml
file and parses it. It also reads a file in src/data/addons/<version>/featured.xml
to tag the featured addons for the main add-ons page and a file in src/data/addons/<version>/history.json
that helps the build system know which add-ons are new/updated. During parsing, images for new and updated add-ons are downloads and stored in static/images/addons/<version>/<addonid>
. When the parsing is complete, the history.json
file is updated.
Each version of the plugin requires an entry in plugins section of the gatsby-config.js
file. Here's what that looks like:
{
resolve: "gatsby-source-kodiaddon-matrix",
options: {
kodiversion: "matrix",
kodimirror: "ftp.halifax.rwth-aachen.de/xbmc",
},
},
The file src/pages/addons/index.mdx
is the main page for all add-ons. There is a link in that file to the add-on section for each version of Kodi. Each addon section has it's own set of static pages as well.
-
src/pages/addons/<version>/index.mdx
is the main page for each section and has dynamically generate content for featured add-ons, new add-ons, updated addons, as well as the categories of add-ons available. -
src/pages/addons/<version>/search.mdx
is the add-on search interface for that Kodi version's add-ons. -
src/pages/addons/<version>/top-authors.mdx
is the dynamically generated list of top add-on authors for that Kodi version.