Skip to content
This repository has been archived by the owner on Nov 8, 2020. It is now read-only.

Latest commit

 

History

History
54 lines (31 loc) · 2.2 KB

updating-site.md

File metadata and controls

54 lines (31 loc) · 2.2 KB

Adding and updating events

Event info for london.html is generated dynamically from js/template.js. Events are listed in a JSON array, stored in the events-data repository.

How does it actually work?

At the bottom of the html page is a template. Anything wrapped in {{handlebars}} is replaced by the corresponding data in the events JSON.

js/all-events-template.js and js/next-event-template.js fetch the JSON from RawGit, which hosts files in your GitHub on a CDN for free. Then the templates are populated with the relevant data and injected into the page.

Our JSON lives inside the events-data repo.

Instructions

Step 1 - edit the JSON

  • Go to the events-data repo and create a new branch off master

  • Edit the events.json file (see the Data Structure section here)

  • Push to your working branch

Step 2 - check it worked :)

In js/variables.js, check the site still works by switching to the development url and loading the page locally. Can also check the JSON updated by pasting the development url in your browser.

If 👍, raise a pull request on the events-data master branch

The URLs for the events data look like this:

// DEVELOPMENT - updates quickly
`https://rawgit.com/node-girls/events-data/${yourWorkingBranchName}/events.json`

// PRODUCTION - updates slowly
`https://cdn.rawgit.com/node-girls/events-data/${commitHash}/events.json`

Step 3 - update the website's CDN link

After the PR for the event data is merged:

  • Create a new branch off master

  • In the events-data repo, grab the latest commit hash from master.

  • In js/variables.js, assign it to the commitHash variable.

  • Raise a PR to master

⏳ The passage of time ⏳

  • When an event's date comes, any links to apply will be hidden.

  • When all the events in the JSON are in the past, i.e. when we haven't got any new events lined up, a message will appear saying:

More events to be announced soon. Check back here or on Twitter for updates!