🚨🚨🚨🚨 Pushing or merging to master will automatically deploy 🚨🚨🚨🚨
Just a few notes on how to work with this setup for the website. The most important is that we are using the static site generator Lektor and are hosting the content on Netlify.
Lektor is a static site generator written in Python. The reason for choosing it (and if you need somebody to blame...it was Seb) was that it provides a much easier way to:
- Customize the website templates without having to build a full themes.
- Create simple and flexible data representations for different parts of the site.
Basically, Lektor has a file-based data model that allows custom objects to be defined such as sponsors, organizers and others.
The best way to understand how Lektor works it to take a look at the content model in the docs and through the code here.
Let's get you started with downloading the latest version of the repo:
$ git clone [email protected]:pycascades/www.pycascades.com.git
$ cd www.pycascades.com
Our site builds using Python 3 and Nox.
Once you have both you can run locally with:
$ nox -s serve
You should be able to view the site by heading to http://localhost:5000.
We are using a hand-rolled extension for Lektor that uses the webassets package
to build CSS and Javascript artefacts. This might have some bugs in it still.
If you make changes to a CSS or Javascript file and changes aren't reflected in the dev server. You should clear the built cache and start the service again:
$ nox -s build
Also let Seb know that he needs to fix this 😇.
We have a data model for sponsors that will automatically include it into the website. Adding an new sponsor to show up on the website, follow these steps:
Create a new folder for the sponsor in contents/sponsors:
$ mkdir contents/sponsors/google-cloud-platform
Now create a content.lr file inside this new directory using this template:
_hidden: yes
---
name:
---
tier:
---
website:
---
logo:
---
signed_on:
The _hidden entry prevents a website from being created for the individual
sponsor. We only want them to show up as part of the sponsor listing.
Copy the logo for the sponsor into the same directory and complete all the
fields in the contents.lr file. This could look something like this:
_hidden: yes
---
name: Google Cloud Platform
---
tier: diamond
---
website: http://cloud.google.com
---
logo: logo_cloud_color.svg
---
signed_on: 2018-09-28
Our Netlify setup is integrated with Github. That means all branches that are pushed to Github will be built on Netlify and will be available on a unique URL. If you need access to the Netlify account, ask Seb.
The master branch is the Production branch.
Ask Seb 🤓.