Skip to content

Add ons

Kyle Johnson edited this page Mar 4, 2021 · 21 revisions

Introduction

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.

Anatomy of the Add-ons Section

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 gatsby-source-kodiaddon Plugin

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. When the parsing is complete, the history.json file is updated.

Configuration in gatsby-config.js

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",
      },

Overview

About this wiki
Information on Site Builds

Routine Editing

Blog Posts
Pages
Download Distributions
Sponsors
Store Items
Featured Add-Ons

Advanced Editing

Installing GatsbyJS Locally
Notes on Editing Pages

Dynamic Content

Add-ons

Site Template

coming soon

Custom JSX Modules

coming soon

Clone this wiki locally