Skip to content

Multiple Sites

Andrew Yates edited this page Dec 14, 2020 · 1 revision

This document lists what is required to introduce a new site.

Environment Variables

To get started you'll need to configure your environment with various variables for the new site.

NEXT_PUBLIC_SITE_KEY

Current Values... Formula 1 - f1 Formula 2 - f2 Formula 3 - f3 Formula E - fe W Series - wseries

NEXT_PUBLIC_CURRENT_YEAR

This defines which year is loaded on the homepage of the site. Allowing future provisional calendars to be accessible but not featured until the end of a season.

Example value: 2021

Content

All content is housed in the db directory, using the NEXT_PUBLIC_SITE_KEY value defined previously as the folder name.

Each site has a config.json file which allows for additional configuration that doesn't need to be housed in environment variables.

{
	"siteKey": "f1",
	"availableYears": [2018, 2019, 2020, 2021],
	"sessions": ["fp1", "fp2", "fp3", "qualifying", "gp"],
	"featuredSessions": ["gp"],
	"collapsedSessions": ["fp1", "fp2", "fp3", "qualifying"],
	"sessionMap": {
		"fp1":"p1",
		"fp2":"p2",
		"fp3":"p3",
		"qualifying":"q",
		"gp":"gp"
	},
	"supportsEmailReminders": true
}

siteKey: Can likely remove.

availableYears: Currently used to show years in the /years page, creating an archive of past seasons.

sessions: A list of sessions for a race weekend.

featuresSessions: The sessions that should be shown by default.

collapsedSessions: The sessions that should be hidden within the collapsed content.

sessionsMap: Used to adjust the URL structure for calendar file generation.

supportsEmailReminders: Whether the site should show a subscribe form for Mailchimp reminders.

Calendar content is named with the year... e.g. 2021.json.

Assets

There are various assets that need to be added to the repo for each site...

  • android-chrome-192x192.png
  • android-chrome-512x512.png
  • apple-touch-icon.png
  • favicon-16x16.png
  • favicon-32x32.png
  • favicon.ico
  • mstile-70x70.png
  • mstile-144x144.png
  • mstile-150x150.png
  • mstile-310x150.png
  • mstile-310x310.png
  • safari-pinned-tab.svg
  • share.png
Clone this wiki locally