Links âą Versions âą Roadmap âą Development guide âą Deployment âą Contact âą Copyright
The Triumph Mayflower Club is an organisation dedicated to the preservation of classic 1950s car, the Mayflower, by British car manufacturer Triumph. The club itself formed in 1974 and made its initial, limited foray into the World Wide Web back in 2005, and then I (Andi, project maintainer) was commissioned in 2017 to create them a new website from scratch when my parents became members. Click here if youâre interested in reading more about the car and the club.
This new website is written in vanilla HTML5 for the documentsâ markup, CSS3 for styling, a small amount of JavaScript (ES6) and is built using Jekyll as a static site generator to minimise code duplication. It is designed to run in any major âevergreenâ browser (i.e. Chromium-based Microsoft Edge, Google Chrome, Mozilla Firefox, Apple Safari or Opera), desktop or mobile, without issue.
The current hosting situation for the production site is only really suitable for hosting a static HTML site (yay, budget constraints of a niche club), so itâs not really practical to host anything other than that, for instance an ASP.NET Core server application for more advanced functionality, so I consider it somewhat of a personal engineering challenge to see how far I can push the limits of what can be done, feature-wise, with a static website, before having to upgrade the hosting to allow for a more complex client-server solution.
The different hosted versions of the website can be found at the following locations, where the canary server is the automatically-generated GitHub Pages site based-on the latest master
, the staging area is a subdomain of the live website that we deploy to manually when we want to test-out new features and the production site is the current publicly-available website (also deployed to manually):
- đ„ Canary: https://stack-in-a-box.github.io/triumphmayflowerclub.com
- đ§Ș Staging: https://beta.triumphmayflowerclub.com/
- đ Production: https://www.triumphmayflowerclub.com/
Oh, and just for the fun of it, hereâs what the old website looked like for comparison!
- â Legacy: https://legacy.triumphmayflowerclub.com/
The GitHub Releases system is used to increment the version of, tag and publish releases, and is the single source of truth for what the current version of the website is. No version numbers are explicitly held in the repoâs files.
Since this codebase is a website, thereâs obviously no need to maintain any release branches to backport fixes to, as thereâll only ever be one live site which will always have the latest changes on it.
When a new version of the site is released via GitHub, the website will query a specific GitHub API endpoint at runtime to get both the latest releaseâs version number and publish date, which is then displayed to the end user in the footer of each page.
SemVer is used, albeit loosely, as a version numbering scheme for the website. The major, minor and patch parts are bumped for a release in accordance with the following types of change to the codebase:
- Major: Complete or significant rewrites of the website where the fundamental technology used has changed, for instance moving from a Jekyll-based static website to a declarative React.js web application, or even a move to a client-server architecture by introducing an ASP.NET Core server application into the mix. A major design refresh of the websiteâs visuals would also fall into this category.
- Minor: For major (i.e. newsworthy) feature update releases. I tend to work on a couple of major new features (either in terms of functionality or new sections of the website) between club AGMs, so the frequency of these updates is usually also annual.
- Patch: For everything else, including but not necessarily limited to: publishing news articles, new content, fixing typos, fixing bugs and broken links, fixing incorrect information and minor new features.
There have been two major releases published so far, which are listed below with their key changes, as well as which features are currently in progress for the next major update â every historical release ever published since going-live with this new site can be found on the Releases page:
- v1.0 â Launch of the new website:
- Entirely new Jekyll-based modern static website for evergreen desktop browsers.
- Built from the ground-up to entirely replace the aging legacy one.
- Visual design follows a quirky skeuomorphic language mimicking a workbench.
- Sections include about, history, news, events, photos, documents, shop, contacts and links.
- Single-step build using Jekyll at the command line.
- v1.1 â News archive and finished visuals:
- An archive-style system for organising our ever-growing list of news articles.
- Finished and integrated the graphical assets that were incomplete by the release of v1.0.
- Added the remaining content to the footer, also originally intended for v1.0.
- New Facebook page created by Andi and Mark Smith (publicity officer).
- News article template Word document, to aid contributors in submitting news content.
- Editable membership forms as PDFs, a step towards signing-up completely online.
- Full GDPR compliance and supporting news article.
- 2019 annual general meeting minutes published.
- vNext â Members-only area (WIP):
- ...
This is a non-exhaustive list of the things Iâd like to add in future development, in no particular order. This is obviously subject to change, but it should be a good indication of whatâs to come. Iâll tick things off as and when they get done. I want to eventually get to a stage where Iâve provided enough tooling so that most of the content can be published by other people, so that Iâm freed-up to work primarily on adding new features.
- A complete archive of every issue of the clubâs magazine.
- A comprehensive collection of technical documentation and guides.
- Historical annual general meeting minutes made available.
- Library of high-quality historical photos.
- Plenty of membersâ photos to be added.
- Simple, client-powered search.
- Members-only area.
- A forum system.
- Members directory.
- Mobile-optimised layout.
- Bespoke CMS-style authoring tools.
- E-commerce integrations (membership, spares, etc.).
- Pre-generated OCR of PDFs and images.
- Powerful server-side search engine.
- Push notifications for new content updates.
- Mailing list signup and delivery system.
- Open Graph integration for sharing to social media.
- Automatic heading anchors (appear on hover).
- Minor features:
- Membership number badges.
- Click-to-zoom on pictures.
- Social media feed widgets.
- Share links.
- Markdown files instead of HTML for new news articles.
- Development of an automated deployment script.
- Continuous delivery (CD) using GitHub Actions.
- Novel client-side user auth system.
- Enhanced languages, e.g. Sass, TypeScript, CâŻ.
- Migration from static site generation to a React.js app.
- Migration to a client-server architecture.
- Conformance with accessibility standards.
- Asset and delivery optimisation.
- Force consistent browser caching behaviour (if possible).
- Reduce code duplication by refactoring using more Jekyll âIncludesâ and âLayoutsâ.
- Make this repo a great place for fledgling web devs to cut their teeth.
- Contribute to open source by spinning-off newly-developed tech into standalone projects.
- Delivery over HTTPS instead of HTTP (not crucial while just a static site).
Iâve tried to write this readme in such a way that those who arenât necessarily familiar with coding have a fighting chance of contributing to the websiteâs development if theyâre so inclined; such as club members. As such, if youâre already a developer, some of these instructions may seem a little overly-verbose, so you can probably skip some elements. Conversely, if youâre not too tech-savvy, I recommend reading everything if you want to be able to help us out with the site â incidentally, youâre absolutely welcome here whatever level of experience (if any), hence why Iâve tried to be as explicit as possible with instructions, so please donât feel put-off if it looks overwhelming! Send me an email if youâd like to get involved but could do with a hand getting started, and Iâd be happy to get you going.
For the most part, these are the bare-minimum requirements for getting up-and-running.
While not strictly a requirement, I personally develop on Windows myself so, naturally, this guide is tailored to getting a development environment established on a Windows PC. If you are on Windows then I highly recommend upgrading to Windows 10 if you havenât already done so:
- Get Windows 10 here: https://www.microsoft.com/windows/get-windows-10
- Upgrade FAQ: https://support.microsoft.com/help/12435/windows-10-upgrade-faq
I have no problem with contributors developing using macOS or Linux assuming you know what youâre doing and stick to Windows-style line endings (CR+LF
). I may expand these instructions in future if thereâs enough demand for people wanting to develop on other platforms â feel free to submit a pull request yourself to update the readme with said instructions if youâre one such developer!
Git is whatâs known as a version control system (VCS) and itâs what millions of developers the world over use every day to manage their codebases. It provides a comprehensive history of changes made to the source code repository as well as tools to help multiple developers work together on the same codebase remotely from potentially anywhere on the planet. The new Triumph Mayflower Website is currently being developed using Git as its VCS to provide a solid backbone for our development process. Follow these steps to install Git for Windows:
- Download and run the Git for Windows installer from their website:
- On the âAdjusting your PATH environmentâ page, select âGit from the command line and also from 3rd-party softwareâ.
- On the âChoosing HTTPS transport backendâ page, select âUse the OpenSSL libraryâ.
- On the âConfiguring the line ending conversionâ page, select âCheckout as-is, commit as-isâ.
- Complete the rest of the setup wizard.
The websiteâs source code is hosted on GitHub (the website youâre currently reading this on). In order to download and alter the source code, youâll need to sign-up for a GitHub account:
- Go to https://www.github.com/.
- On the GitHub homepage, choose a username and enter an email address and password, then click âSign up for GitHubâ.
- Follow the instructions on the next page to verify your account, then click âJoin a free planâ.
- Enter the most applicable options for you on the âWelcome to GitHubâ page.
- Check your emails for a verification email (make sure itâs not in your âjunkâ/âspamâ folder) and click the âVerify email addressâ link.
- Load Git Bash and run the following command â entering an empty passphrase is fine.
ssh-keygen
- Copy the contents of the public SSH key file that was generated to the clipboard by running:
cat ~/.ssh/id_rsa.pub > /dev/clipboard
- Back on the GitHub website, click the user icon in the top-right corner followed by âSettingsâ.
- On the left-hand menu, click âSSH and GPG keysâ followed by âNew SSH keyâ.
- Paste the contents of the clipboard into the âKeyâ field and click âAdd SSH keyâ.
- Your Git Bash client will now automatically authenticate you when youâre communicating with GitHub through the said clientâin other words, you wonât need to enter a username and password every time you try to interact with it!
For those unfamiliar, a Git ârepositoryâ, or ârepoâ for short, is a set of source code files (usually stored on a centralised âremoteâ server somewhere) alongside specific Git-managed metadata files which contain information about where the remote server can be found on the internet (or local network), various pieces of configuration information and, most importantly, a complete history tree of all changes made to the codebase â what specific changes were made at each stage, when they were made, who made them and how they were integrated back into the primary flow of code from temporary âbranchesâ where developers can work on isolated copies of the code without interfering with other devs working on the same codebase.
In order to make changes to the website and see the effect those changes have, youâll need to download the source code to your local machine in whatâs called a âcloneâ operation. This will download a copy of the source code repository to your file system and allow it to be managed by Git:
- Create a directory (folder) somewhere on your filesystem without any space characters in the path (a common convention among developers is
C:\dev
; I personally keep my repos inC:\Development\Repositories
). - Load Git Bash and enter the following command to change the working directory to the newly-created folder (assuming you chose
C:\dev
):cd /c/dev
- Clone the website repository by entering the following command:
git clone [email protected]:Stack-in-a-box/triumphmayflowerclub.com.git
- When asked whether you want to continue connecting to GitHub, type
yes
and hit [Enter]. - Once the clone operation has finished, enter the following command to change the working directory to the root directory of the local repository:
cd triumphmayflowerclub.com
When youâve downloaded a local copy of the repository, you need to configure Git such that it automatically credits you as the author of any code changes you make:
- Set your name by running the following command and replacing
<name>
with your first and last name:git config --local user.name "<name>"
- Set your email address by running the following command and replacing
<email>
with the email address you used to register your GitHub account with (you donât need the quotes either side of the email address like with setting your name in the previous step, as it wonât contain any spaces):git config --local user.email <email>
Jekyll is whatâs known as a âstatic site builderâ. It allows us to reduce the amount of repeated code throughout the codebase, by âfactoringâ the commonly used parts of a page (such as the title image, navigation bar, page footer, primary styles, etc.) into single files which are simply referenced in specific pages; then, when Jekyll is run to âbuildâ the site, it will re-insert the factored-out code into each of the source files that reference it, creating a reconstructed set of files which can then be deployed to the live server and opened in a web browser.
(Note: At the time of writing, which is July 2020, Jekyll doesnât fully support WSL 2, as it doesnât receive all file-system update events which are required for the jekyll serve
feature that allows for automatically-triggered rebuilding whenever source files change, so stick to WSL 1 for the time being.)
- Open an elevated PowerShell instance by searching for âpowershellâ in the search box on the taskbar (assuming Windows 10) then pressing [Shift + Enter] to run it as an administrator.
- Enable the Windows Subsystem for Linux (WSL) feature by running the following command in the elevated PowerShell prompt and reboot when prompted to do so:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
- Open the Microsoft Store, search for the Ubuntu app, install it and then click âLaunchâ once itâs installed.
- The app, once open, will take a few minutes to perform some initial under-the-hood set-upâŠ
- When prompted, enter a username and password to use when dealing with WSL (doesnât have to be the same as your Windows login credentials).
- At the
bash
prompt, which should look something like<username>@<machine>:~$
, run the following command to update the list of packages that can be installed and repositories to install them from (enter your UNIX password when prompted). This will take a while to complete:sudo apt-get update -y && sudo apt-get upgrade -y
- Install Ruby by running the following 4 commands one after the other:
sudo apt-add-repository ppa:brightbox/ruby-ng
(press [Enter] to confirm)sudo apt-get update
sudo apt-get install ruby2.7 ruby2.7-dev build-essential
(enter âYâ when asked)sudo gem update
- Finally, install Jekyll by running the following:
sudo gem install jekyll
Once Jekyll has finished installing, in an Ubuntu terminal session, and assuming you chose C:\dev
as your location for storing your repositories, perform the following steps to spin-up a local development server instance:
- Change the working directory to the root directory of the local repository by entering the following command:
cd /mnt/c/dev/triumphmayflowerclub.com
- Run Jekyll in âwatchâ mode, so that it rebuilds the site whenever the source files change, by issuing the following command:
jekyll serve
- Wait a little while for the initial build to take place, then
Server running... press ctrl-c to stop.
will be displayed. At this point, open a web browser and navigate to http://localhost:4000/ to view the website running locally from your local copy of the source code. - Whenever you make changes to a file and save it, Jekyll will pick-up on this and automatically trigger a new build. To see your changes in your locally-hosted site, look in the terminal and wait for the regenerating to complete (
...done in x seconds.
will be shown, wherex
is the number of seconds it took to generate the new changes). At this point, you can refresh the page loaded in your browser and the changes will appear on the site.
(Note: Jekyll doesnât always notice when brand new files are created, so if you refresh your browser and the page isnât accessible, try closing Jekyll and running it again, and the new page should then be included in the build.)
Iâve recommended some tools you may want to use for development. None of these are required, they just might make working on the site easier.
Youâll need a web browser, preferably a Chromium-based one, such as Microsoft Edge (included with Windows 10) or Google Chrome, in order to test any changes you make to the website before committing them to the codebase.
If youâre going to be modifying the websiteâs source code, youâll need a good text editor. I recommend using Visual Studio Code as itâs modern, lightweight, cross-platform and has many features that youâd usually find in a fully-fledged IDE such as syntax highlighting, code completion, IntelliSense and a large ecosystem of plugins. For simple website development using vanilla HTML, CSS and very occasional JavaScript, it should work extremely well out of the box without any configuration changes or additional plugins:
- Download and run the Visual Studio Code installer from their website:
- Continue through the installation wizard until the end. The default options are fine.
Not a necessity but it can be useful when authoring news articles or content for inclusion on the site, as it automatically adds typographical Unicode characters that are required by our code standards (to be documented at some point in the future), such as âsmart quotesâ, en dashes, etc. The full version of Word is obviously paid software as part of the Office suite of applications, but there are plenty of decent, free, open-source alternatives that offer similar functionality.
Photoshop is what I use for photo editing, but most editors should do a good job of simple editing tasks.
My vision for this project, as it evolves, is that it will start to attract a small core team of developers and non-technical contributors, such that it becomes a great place where those wanting to get their hands dirty with some open-source website development can do so. Having more team members will also free me up to work on feature additions, major refactors and integrating new technologies.
Eventually, it would be great if I had time to develop a simple, bespoke set of CMS-style authoring tools that would let non-technical club members author and submit news articles and other content for inclusion on the site with minimal or even zero technical intervention. As it stands, the site will need manually updating by technically-minded folk for the foreseeable future, but hopefully weâll get to this stage someday.
To deploy either the staging or live site, perform the following:
- Make sure your local repository is in a clean state and that the changes to be deployed are checked-out.
- Issue the following command in Ubuntu to build the source code:
jekyll build
- Download and install WinSCP from the Microsoft Store.
- When prompted, enter the following details into the âSessionâ pane:
- File protocol â SFTP
- Host name â triumphmayflowerclub.com
- Port number â 22
- User name â (Obtain from a website admin)
- Password â (Obtain from a website admin)
- Say âYesâ when WinSCP asks if youâre okay connecting to an unknown server and adding its host key to a cache.
- In the left-hand panel, navigate to the
_site
directory in the root of your repo, as this is where Jekyll places the output from the site generation process. - In the right-hand panel, navigate to either the
beta.triumphmayflowerclub.com
orpublic_html
subdirectory, depending on whether youâre deploying to the staging or live site respectively. - In the right-hand panel, delete
index.html
and renameupdating.html
toindex.html
. Ideally, this would be an atomic operation to minimise the risk of someone being unable to load the homepage, but the timeframe in which this happens and the relatively few people accessing our website mean that this isnât really an issue in practice. This will be addressed properly once we start using GitHub Actions for continuous deployment. - Select all files in the left-hand source panel, with the exception of
index.html
, and drag them across to the right-hand destination panel. - Click âYesâ when prompted to begin the file transfer.
- When asked to confirm whether overwriting is okay, click the small downwards arrow on the right-hand side of the âYesâ button and click âNewer onlyâ. This will begin the transfer.
- Once this transfer has completed, copy
index.html
from the source panel to the destination one to overwrite it. The deployment is now complete.
If you need to get in-touch with me (Andi Emma Davies-Wilcox â lead developer), please do so at the following email address: [email protected]
Copyright © Stack-in-a-box Software 2017â2021
Copyright © Triumph Mayflower Club 2005-2021