The https://dart.dev site, built with Jekyll and hosted on Firebase.
We welcome contributions, and we're first-timer friendly!
For simple changes (such as to CSS and text), you probably don't need to build this site. Often you can make changes using the GitHub UI.
If you want or need to build, follow the steps below.
Help us improve these instructions! If you have any problems getting set up to build or performing the actual build, please edit this README or file an issue (or both).
Install the following tools if you don't have them already.
- bash, the Bourne shell. These instructions assume you're using
bash
-- setup might not work if you use another shell. - nvm, the Node Version Manager.
- rvm, the Ruby Version Manager.
- Dart
IMPORTANT: Follow the installation instructions for each of the tools carefully. In particular, configure your shell/environment so that the tools are available in every terminal/command window you create.
NOTE: This repo has a git submodule, which affects how you clone it.
To clone this repo (site-www), follow the instructions given in the GitHub help on Cloning a repository, and choose one of the following submodule-cloning techniques:
- Clone this repo and its submodule at the same, use the
--recurse-submodules
option:
git clone --recurse-submodules https://github.com/dart-lang/site-www.git
- If you've already cloned this repo without its submodule, then run
this command from the repo root:
git submodule update --init --remote
IMPORTANT: Whenever you update your repo, update the submodule as well:
git pull; git submodule update --init --remote
NOTE: It is safe to (re-)run all of the commands and scripts given below even if you already have the required packages installed.
Open a bash terminal/command window and execute the following commands:
cd <path-to-this-repo>
# change to root of this reposource ./tool/env-set.sh
# initialize environment variables; install/use required Node & Ruby version./tool/before-install.sh
# install core set of required tools./tool/install.sh
# install everything else needed to build this site
IMPORTANT:
- Any time you create a new terminal/command window to work on this repo, repeat steps 1 and 2 above.
- If you upgrade Dart then rerun all of the steps above.
Once everything is installed, you need to do a full site build at least once:
jekyll build
# full site build
The generated site is placed in the _site
folder. To serve this folder use:
npx superstatic --port 4000
Or, if you aren't testing redirects, use this command (which has the bonus of autorefreshing your browser after edits):
jekyll serve --livereload
To view the generated site open localhost:4000 in a browser.
You can build, serve, and have a watcher for changes by running the following command:
./tool/serve.sh
If you've made changes to this site's documentation and committed locally, then run the following command before pushing your work:
./tool/pre-push.sh