The website for HackTJ 8.0.
yarn install
We use React.
git clone [email protected]:HackTJ/2021.git 2022 && cd 2022/
yarn install
git reset "$(git commit-tree HEAD^"{tree}" -m "Push HackTJ 8.0 website" -m "$(yarn run git-history-coauthors)")" # squash all commits into 1
git remote set-url origin [email protected]:HackTJ/2022.git
git push
yarn upgrade-interactive
yarn dedupe
yarn run lint
yarn run test
yarn run switch event
: switch to the event repository (configures the project so that builds are for/2021
)yarn run switch homepage
: switch to the homepage repository (configures the project so that builds are for/
)yarn run start
: starts a development server on port 3000 and watches files for changes, compiling them on the flyyarn run build
: compiles all files to thebuild/
directory but doesn't watch for changes or start a serveryarn serve build/
: starts a static server using the files inbuild/
yarn run deploy event
: pushes to thegh-pages
branch of this repository and deploys the site to https://hacktj.org/2021yarn run deploy homepage
: pushes to the hacktj.github.io repo and deploys the site to https://hacktj.orgyarn run deploy all
: shortcut for bothyarn run deploy event
andyarn run deploy homepage
In the case that one of the endpoints (/2021 or /) doesn't work but the other does, immediately set up a hardcoded redirect in the nonfunctional repository to redirect to the correct site.
To test a production build locally:
yarn run switch homepage
yarn run build
yarn serve build
To deploy a change:
yarn run start
- make your changes; when you're done, close the development server
yarn run lint
git add . && git commit
yarn run deploy event
; make sure the deployed site looks goodyarn run deploy homepage
; make sure the deployed site looks goodgit push
- create a new repository under the HackTJ organization for each event
- the
deploy event
script doesn't commit the source code to the repository's main branch, it only commits the built website- you should commit the source code to the
main
branch each time you deploy- before you commit to
main
, always make sure you runyarn run switch event
- if you need to, create a pre-commit hook to automatically do this
- before you commit to
- you should commit the source code to the
- don't run
git pull
afteryarn run switch homepage
- only pull when you're set up for the event repository