The static website for 2025.pycascades.com built with Lektor
- Clone this repo somewhere on your machine
- Install Python, and create a virtualenv
- Install Lektor
pip install lektor
- Lektor uses
imagemagick
, you'll need to install this as well
- Start the dev server with
lektor serve
- This starts a web server at
http://127.0.0.1:5000/
, where you can preview the site and use the admin panel to add new pages or other content.
- This starts a web server at
Adding content in Lektor is relatively easy once you know how to do it. There are two main ways to add content to the Lektor site:
- Via the localhost web server (accessed by running
lektor serve
and navigating tohttp://127.0.0.1:5000/
) - Adding a folder within the
content
folder, and putting acontents.lr
file in it- A
contents.lr
file is a key-value file, where each key and value is separated by---
, which allows values to be multiline.
- A
Each page on the static site has an associated model, the default model type is the page
model,
defined in the models/page.ini
file. You can change the model for each page by setting the
_model
key in your contents.lr
file. For more information see the
Lektor docs.
Each model has a default template associated with it, the template file matches the model name, so
the page
model is rendered by the page.html
template found in the templates/
folder. The
template files are Jinja2 HTML templates. Additional information regarding templates can be found
in the Lektor docs.
To add a new page navigate to the local host server, then navigate to the page that you want your new page to be the child of. For example, to add a new page under the "about" section of the site:
- Navigate to
http://127.0.0.1:5000/about/
- Click the pencil icon in the top right corner to navigate to the page admin mode
- Click
Add Page
in thePage Actions
on the left side of the screen - Set your model, title, and ID
- Page is the default model, it will let you write page content in markdown
- Title this will be rendered as the tab title, and what you see in the page admin mode when navigating between pages
- ID is the "url slug", and the underlying folder name. It is autogenerated, typically you don't need to change the default value.
- Fill out the additional fields on the next page
- You can change the title at any time, but it will not change the ID. To change the ID you'll need to manually rename the folder
- If you chose the "Page" model the only other thing you can edit is the "body", this is a Markdown field
- Attachments can be added as well, for more information see the Lektor docs.
- Navigate to
http://127.0.0.1:5000/about/the-team
- Click the pencil icon on the top right corner
- Click
Add Page
in thePage Actions
on the left side of the screen - Set your title, and ID
- Note: you cannot choose a model here, because it is automatically selected to be a
blog-post
model, because thenews
page uses theblog
model, which specifies that child pages use theblog-post
model.
- Note: you cannot choose a model here, because it is automatically selected to be a
- Fill out the additional fields on the next page
- Add an attachment called
profile.jpg
that will be used as their photo on the team page
- Navigate to
http://127.0.0.1:5000/news/
- Click the pencil icon on the top right corner
- Click
Add Page
in thePage Actions
on the left side of the screen - Set your title, and ID
- Note: you cannot choose a model here, because it is automatically selected to be a
blog-post
model, because thenews
page uses theblog
model, which specifies that child pages use theblog-post
model.
- Note: you cannot choose a model here, because it is automatically selected to be a
- Fill out the
Author
,Publication date
,Intro
, andBody
on the next pageIntro
should be the first paragraph or so of content that you want visible on the/news
page which lists all of the recent blog postsBody
is the main content of the post, but is hidden from the list view
In order to add a new speaker and/or talk you must first log into the pretalx account and export the speakers and sessions.
- Click "sessions" in the sidebar, then click "export"
- Under "Export format" select "JSON export"
- Under "Target group" select "confirmed"
- Under "Data fields" click the "select all" checkbox
- Click the save button
- Copy the exported file to the root of this repo
- Click "speakers" in the sidebar, then click "export"
- Under "Target group" click "With confirmed proposals"
- Under "Data fields" click the "select all" checkbox
- Undr "Export format" select "JSON export"
- Click the save button
- Copy the exported file to the root of this repo
Run the init_program.py
file which will read the JSON exports and add a new page for every new talk or speaker
- Delete the associated folder(s) under the
content/program/talks
and/orcontent/program/speakers
- Run
init_program.py
which will re-generate a page for each speaker or talk you removed
All changes you make, either edits to a specific page, or new pages added, are all saved to disk. Once you are done you'll want to commit the new or changed files to your branch in Git, and open a pull request. An organizer will review your changes and merge them if they are ready. Once merged an organizer will deploy your changes to the live site.
Deploying is easy:
First you must build:
$ lektor build
Then deploy:
$ lektor deploy ghpages
Lektor will commit the built site to the gh-pages
branch, and push, which will get deployed by
GitHub automatically.
- Write docs
- Adding and Editing Speakers
- Add model for Schedule
- Including Docs
- Finish base layout and styling
- Speakers
- Add in-page links in page overviews
- Health and Safety Policy
- Health and Safety FAQ
- Add YouTube video embed to attend/attending-remotely page
- Fill out the content for the following pages:
- Attend
- Attending In Person (partially completed)
- Tour Portland
- Program
- Schedule
- Social
- Speakers
- Sponsors
- Sprints
- News
- Attend