This repository contains tools used in building QCR-branded websites.
It includes:
- styled QCR React components for building pages
- a custom QCR Material UI theme
- some sensible default global CSS styles
- complete demo page for exploring how to use the components
Make sure you have the latest LTS of NodeJs installed (see guide below).
- Clone this repository, and enter the new
sites-shared
directory:git clone https://github.com/qcr/sites-shared; cd sites-shared
- Install node dependencies locally:
npm install
- Start the local development server:
npm run dev
- Navigate to localhost:3000 in your browser
- Create a new TypeScript-enabled NextJs app, which will be created in a new directory in your current folder:
npx create-next-app@latest --typescript
- Add this package as a dependency for your new project:
npm install git+ssh://git@github.com:qcr/sites-shared.git#master
- Add the QCR theme, CSS, and favicon to your
pages/_app.tsx
(see example in ./pages/_app.tsx) - Start building your site by adding QCR components to
pages/index.tsx
(see example in ./pages/_app.tsx)
If you have extended this package and wish to use the extensions in QCR sites perform the following:
- Add and commit your changes
- Add a git tag:
git tag v<x.x.x>
- Push to origin with tags:
git push origin --tags
Remember then to update the downstream sites to use the new sites-shared tag.
- Install directly from apt:
sudo apt install nodejs npm
- Globally install the node version management tool:
sudo npm install -g n
- Update to the latest LTS:
sudo n lts