Git Product home page Git Product logo

2019.indypy.org's Introduction

Website for PyCascades

๐Ÿšจ๐Ÿšจ๐Ÿšจ๐Ÿšจ 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.

Why Lektor?

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:

  1. Customize the website templates without having to build a full themes.
  2. 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.

Running Lektor locally

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

Lektor needs Python (I think we all do ๐Ÿ˜‰). This means you'll have to setup a virtualenv before you can install it:

$ pipenv --three
$ pipenv shell

Now you're ready to get things installed:

$ pipenv install --dev

And with Lektor finally installed, you can run the built-in development server:

$ lektor server

You should be able to view the site by heading to http://localhost:5000.

Changes to CSS / Javascript

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:

$ lektor clean -yes && lektor server

Also let Seb know that he needs to fix this ๐Ÿ˜‡.

Adding Sponsors

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

Deploying the site to Netlify

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.

Questions?

Ask Seb ๐Ÿค“.

2019.indypy.org's People

Contributors

mbokerson avatar abosio avatar roadsideseb avatar robzonenet avatar mariatta avatar theacodes avatar ericholscher avatar cache-rules avatar ulysseas avatar glasnt avatar bryanchow avatar greh avatar

Stargazers

Tony Patton avatar  avatar

Watchers

Clayton Parker avatar  avatar Rob McBroom avatar James Cloos avatar

Forkers

ppang0405

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.