This is the code for the decred.org website.
The below commands must be run when either the content changes or there are updates in the translations in Transifex. You'll first need to install the Transifex client.
Make sure you have git installed.
git clone https://github.com/decred/dcrweb
cd dcrweb;
When translations are added/updated in Transifex, pull the updates:
npm run transifex:pull
When you run this for the first time, you'll be asked to log in with your Transifex username/password.
To push the changes to staging:
git commit -m'Translation update'
git push origin
This triggers the update on the staging site, which will be rebuilt usually in a few minutes (give it 5):
When the master content changes in the HTML files, you'll need to re-generate the message catalog and push it to Transifex so that translators can update the localized message catalogs:
npm run transifex:push
- Add the new language in Transifex
- In the repository folder, run
npm run transifex:pull
, add the new .po file to git:git add i18n/po/<LC>.po
- Enable it for publishing on the staging site: add it to
src/i18n/languagemap.development.txt
- Update language selector in
src/index.html
- Commit files to git + push to repo
Once you're happy with the translation in a language, you'll need to enable it for production.
- Add language to
src/i18n/languagemap.production.txt
- Edit
#language-selector
insrc/index.html
- Commit files to git + push to repo
A Docker configuration is included for building the deployable images of dcrweb.
- docker
git clone https://github.com/decred/dcrweb
cd dcrweb
./build_docker.sh
This builds a docker container which can then be run using:
docker run -d --rm -p <local port>:80 decred/dcrweb:latest
docker login
Enter your Docker HUB credentials that has write access to the decred/dcrweb
repository.
docker push decred/dcrweb
docker pull decred/dcrweb
docker run -d --rm -p <local port>:80 decred/dcrweb:latest
Runs the docker image exposing the specified local port.
-
Install prerequisites:
- Node v8 (preferably via nvm)
grunt
- Docker
-
Clone repo
git clone https://github.com/decred/dcrweb cd dcrweb yarn install
-
Start development web server:
yarn dev
-
Start file watcher:
grunt watch
You should now be able to access the site at http://localhost:8080
decredweb is licensed under the liberal ISC License.