ln4b ('Liveable Neighbourhoods for Bristol') is a static site owned by Bristol Cycling Campaign.
It campaigns for liveable and low traffic neighbourhoods in Bristol, UK.
The site was created from scratch using HTML and CSS. Sass is used as the CSS compiler. BEM is used for naming visual components. Bootstrap is used for styling some components (buttons, form fields), though everything else (including layout) uses CSS3.
Follow the steps below to get started with the project:
-
Clone this repo to your machine. (Learn how here.)
-
In the terminal, set up Sass to watch all stylesheets in
styles/sass/
and compile them in tostyles/css/
:
$ sass --watch styles/sass:styles/css
- Make changes to the website and test locally.
- Push to GitHub on the
master
branch. Changes will be made live on the staging site athttps://zackads.github.io/ln4b
.
- If changes are accepted once in staging, push to production by logging in to Buddy. (You may need additional permissions to do this; speak to Zack).
Due to the simple nature and limited scope of this site, we push directly to master
and roll back if we don't like the changes. There is no need to create a new feature branch unless the change is substantial (e.g. adding an additional page or re-designing the site).
The "Find your local group on Facebook" CTA (#postcode-lookup
) works like this:
-
User enters postcode and submits form.
-
App queries the postcodes.io API, attempting to get the ward the postcode is in.
-
If postcode-to-ward lookup via postcodes.io API succeeds, app looks up the user's ward in
assets/data/ln_groups.json
. -
If ward-to-Facebook-group lookup via
ln_groups.json
succeeds, app links the user to their local Liveable Neighbourhoods Facebook group. -
If either of the lookups fail, app serves an error message and invites the user to get in touch with the Liveable Bristol campaign via email.
The moderately self-documenting code for this is in script.js
.
Change requests from non-developers should be submitted as a Slack message in the #ltn-microsite channel in a format similar to:
Change request: Add Eastside Community Trust logo.
Logo is in the usual folder. Hovertext to be "Eastside
Community Trust". Hyperlink to be "www.eastsidecommunity.com"
A developer can then 'assign' the change request to themselves with a comment, and mark as done with a green tick emoji.
If a new Liveable Neighbourhood Facebook group needs to be added, simply append a new property to the existing JSON in ln_groups.json
following this schema:
"<ward name>": {
"name": "<Facebook group name>",
"url": "<Facebook group URL>"
},
For example:
"Eastville": {
"name": "LNs for Eastville and Fishponds",
"url": "https://www.facebook.com/groups/289211205662975"
},
<ward name> must exactly match the official ward name. If in doubt check the return value from the postcode.io API.
❌ Incorrect ward name:
Hengrove & Whitchurch Park
✅ Correct ward name:
Hengrove and Whitchurch Park
Reach out to either Zack or Alex M on the Bristol Cycling Campaign Slack workspace or contact hello@liveablebristol.org.uk.