Closed dmijatovic closed 9 months ago
Hi @dmijatovic , many thanks for putting this together. It is incredibly useful and will make our life way easier.
I cannot give you a date for us to work on this, but I suspect that it will be while you're away. I am sure we will manage, so don't worry too much. Chances are this will be tackled by @cc-a , who leads the project from our side, and @CWestICL , another member of our team who has experience with React.
We will keep in touch.
@dalonsoa Thanks for the update! I will be happy to help after I am back from vacation (August 7th 2023) if any help is needed :-).
Custom Imperial College homepage starter
This is the starter/example/template of custom homepage for Imperial College London. @dalonsoa Maybe you can use this PR/branch as a starter?
Used frontend technologies (knowledge required/use documentation):
Basic setup
To add a custom landing page for imperial we use the following two-stage approach:
There is a
frontend/components/home/imperial
folder located in this repo that contains the components needed for the Imperial landing page. An simple template is provided (see below for more details) which can be extended.There is a separate
deployment/imperial
folder (in the .gitignore of this repo) which contains data items likesettings.json
,index.css
, fonts, etc. As there can only be one copy of these files, the different implementations (default, helmholtz, imperial) have different value and will clash. We therefore mount this folder separately in thedocker-compose.yml
(example provided in the PR). This allows each instance of the RSD to use its own styles. An example of the content of this folder is provided in imperial.zip. See below for more details.Changes proposed in this pull request:
imperial
host name in the homepage route (/frontend/pages/index.tsx)/deployment/imperial
folder. This is the folder where all custom settings should be saved. The content of this folder is mounted into the frontend image fordocker development
usingmake frontend-docker
deployment/imperial
folders in the docker-compose.yml (as demo how it should be done).frontend/components/home/imperial
folder and the starter components.How to test:
download imperial.zip file. It contains the custom files that can be used. Unzip the content into deployment folder. After unzipping you should have following structure in the
deployment/imperial
folder:data
: holds settings.json where you can specify host.name, other contact information and the theme collors. I changed few values: host name, logo, contact email, primary and secondary colors. Further adjustments of settings.json are needed.images
: all images are stored in this folder. I added imperial-college-logo.svg. Add all other custom images you will be using.styles
:index.css
is global css file imported in the main template (see frontend/pages/_document.tsx - line 44). Here you can specify additional global custom styles and the custom fonts. The attached file currently defines RSD custom fonts. The file should be updated to custom Imperial College fonts and RSD fonts removed if you do not want to use them.make frontend-docker
to run development in docker and have the custom settings and styles mounted. The homepage should look like image belowThe frontend is on http://localhost:3000/
Note! You will need to reload the page manually after changing the values in
/deployment/imperial/data/settings.json
. For example by changinghost.name
fromimperial
torsd
will load default rsd home page content, or when usinghelmholtz
you should see custom Helmholtz page.Current state of custom homepage for Imprial College London
PR Checklist:
docker-compose.yml