Template for workshop websites
The repository consists of very few important directories:
- bin - contains the nodejs executable aptly named www
- public - the materials subdirectory is where we stored the courses PDFs - try to keep this small, i.e. no data!
- routes - this contains the js files; i.e. the logic behind the webpage behavior
- views - this contains the files that will generate the html; these are written in pug.
The other directories/files are managed by nodejs
-
https://nodejs.org/api/ - The nodejs API
-
https://www.npmjs.com - The JS module repository
-
https://expressjs.com/en/4x/api.html - The minimal nodejs module we use
-
http://www.w3schools.com/bootstrap/default.asp - The "CMS" we use (Bootstrap)
-
https://www.npmjs.com/package/pug - The template language for writing HTML
First, create a new branch from the most recent branch of the same course or from the master
To edit the website for a course, you need to:
- Edit the title of the course in the index, connect and materials pug view files (Look for the first h1)
- Edit the short version of the title in the index, connect and materials js routes files (Look for :title:")
- Edit the participant list in the connect.js file (At the moment this is a bit convoluted as we used 2 servers and had to divide the participants across, but ideally it should be a simple user-ID list. The ID is later used to assign the Port number to connect to the user-specific Docker containers.
Check the node JS module repository and update the package.json file accordingly.
docker run -d -p 3000:3000 -v /mnt/picea/projects/docker/SLUBI2020:/course-web/public/materials delhomme/upscb-nodejs:Berlin24
-
provide a user file instead of modifying the connect.js
-
handle different IPs more gracefully than in the connect.js
-
provide the course title in a single place to avoid editing all js files and the index, connect and materials pug view files
-
Find a way to import materials to public/materials instead of git-ing everything