european-lisp-symposium / els-web

European Lisp Symposium Website Tools
https://european-lisp-symposium.org
19 stars 8 forks source link

About ELS-Web

This is a system that contains all data related to the European Lisp Symposium, and is able to compile it into a static website for publishing.

Cloning the Repository

This repository makes use of Git LFS for storage of several large files (images, pdfs, etc.) In order to properly clone all the data and contribute to the repository, please first make sure Git LFS is installed on your machine. Typically it should be available as a git-lfs package. Following that, run these commands to clone the repository:

If all went fine, the file at els-web/output/static/favicon.png should be a binary image. If something went wrong it will be a plain text file. In that case, Git LFS was not properly set up. Please make sure you have installed it correctly and try again.

When pulling, please make sure to pull with rebase to avoid merge commits and branching history. You can do so either explicitly with git pull --rebase or configure rebase as the default with git config --bool pull.rebase true.

How to Define an Edition

An edition is created by defining a new package of the editions' name --usually its year-- and following it up with various data definitions. The basic outline is as follows:

(in-package #:els-web-editions)
(define-edition "2025")
(in-package "2025")

(define-text :announcement
  (:div :class "announcement" "A new edition is coming along!"))

(define-date "Conference start" @2025-05-23)
(define-date "Conference end" @2025-05-24)

;; etc.

When a definition is recompiled, its data is updated if possible. Each data entry is identified by one or more key fields. If those are changed, the data will instead be added again. To avoid this, you can recompile the entire file, which will first clear out all the data through the define-edition macro, and then add it all anew.

If you add a new edition, you should place it into the editions directory, and then add the file to the ASDF system definition, such that the edition is automatically recognised once the system is loaded.

Data Definition Constructs

Many of these definitions accept arbitrary data fields in the form of a plist. The following fields are specially treated and respected by the templates.

Fields for People and Locations

Fields for Programme Entries

Fields for Sponsors

Fields for Registration

The registration definition is composed of a number of items. Each item has the following structure: a type, a name, and attributes. The type should be either :kind for primary registration types, and :option for optional features attendees can request. The name should uniquely identify the item in the list. The following attributes can also be specified:

Once registrations are closed, you should set the entire registration block to :inactive.

Extracting the Data

The data can be easily retrieved through the query function that does some light matching. The filter argument can be of the following structure:

FILTER ::= everything | CLAUSE
CLAUSE ::= (= DATA DATA)
         | (in DATA DATA)
         | (and CLAUSE*)
         | (or CLAUSE*)
         | (not CLAUSE)
DATA   ::= keyword | data-field | data-value
everything --- The symbol T to represent all data
keyword    --- A keyword symbol that is directly used as a value
data-field --- A symbol representing the value of a field in a data entry
data-value --- Any kind of object that is directly used as a value

Comparison between values is done through g=, which is a form of "generalised equality." Specifically, the following holds:

These weakened comparisons are done to make it more convenient to extract the data within templates.

Secrets File

Some parts of the website require keys and tokens that should not be made public in a repository like this. Thus, this includes a simple "secrets" mechanism. The system expects a file called secrets.lisp within its root directory. This file should contain a single plist of keywords to strings. The following keys are required:

Note that for Stripe you should use the provided testing keys during development, and use the production keys for the deployed website. Using either key set on the other environment is a very bad idea.

Writing the Templates

The templates are written using the Clip system. For the most part the data is introduced using the aforementioned query function, and its abbreviations query1 and queryf. Common structures like locations, people, and programme entries are separated out of the primary index.ctml template and spliced back in using the <c:splice> tag.

What's going on in the templates should not be too difficult to figure out. Otherwise, have a look at Clip's and perhaps also lQuery's documentation.

Actually Compiling the Editions

You can compile the edition data using compile-edition. When you add or remove an edition, you should also compile all the other ones as well, in order to ensure the cross-links are still valid. You can do so with compile-all-editions.

The resulting static files will be placed in the output directory, automatically overwriting previous files. In order to publish the site, you simply need to copy the entire output directory, or make it visible through a webserver somehow.

Deploying on a Server

In order to deploy ELS-web on a server, you will need a PHP5 capable server. I'm well aware that using PHP sounds like heresy for a Lisp project, but many servers don't offer direct root access to run a Lisp instance.

Either way, in order to deploy it, you will need the full ELS-web repository, including a filled out secrets.lisp file. The server-side registration script will access this file to retrieve some options. While the root of the project does need to be accessible to PHP, it should naturally not be accessible to the web. The document root that your web server should serve is the output directory.