(Note: Sphinx versions higher than 1.1.2 are required.)
Documentation about adding a new person to the CNERG website can be found here. It also contains some information on downloading and building the website.
A 2 branch system has been implemented to maintain a clean process of rebuilding this site.
-
The
sourcebranch contains the restructured text documents and Sphinx configuration used to build the site. All direct editing of files should be made in thesourcebranch. -
The
masterbranch contains the processed and published web content that is derived by Sphinx from thesourcebranch. These files should not be editted directly.
-
Checkout the
sourcebranchgit checkout source -
Synchronize your branch with the repository (either
pullorfetchandmerge)git pull upstream -
Create a branch to contain your change
git checkout -b add_some_info -
Make your changes in this branch
-
Test your changes by using the
gh-previewtargetmake gh-previewThis will build a version of the site in the
gh-builddirectory of your branch,add_some_info. You can load it directly in a local browser. -
Repeat steps 4-5 until satisfied.
-
Once satisfied with the source RST files, push your branch to the repo. Be sure to synchronize with any possible changes to the
sourcebranch first.git fetch upstream git rebase upstream/source git push upstream add_some_info -
Issue a pull request by going to your branch on the repo and clicking the "Pull Request" button.
-
Synchronize your repository with the remote repo
git fetch upstream -
Checkout the
pull_request_branchgit checkout -b pull_request_branch upstream/pull_request_branch -
Test the changes by using the
gh-previewtargetmake gh-previewThis will build a version of the site in the
gh-builddirectory in your branch,pull_request_branch. You can load it directly in a local browser. -
If satisfied, merge the
pull_request_branchinto thesourcebranch. Be sure to synchronize with the remote repo first.git checkout source git fetch upstream git rebase upstream/source git merge pull_request_branch -
If there are no conflicts, push this to the repo
git push upstream source -
Republish the pages with the
gh-publishtarget.make gh-publish
To build CNERG website using docker you can use the cnerg container containing
all the required dependencies to build the website
cnerg/cnerg.github.io-deps.
From the directory containing the website repository (if you don't have one yet
please clone it first):
-
run the docker container:
docker run -u $UID -v $PWD:/local_drive -it cnerg/cnerg.github.io-deps -
go into the mounted folder in docker:
cd /local_drive -
build a preview of the website:
make gh-preview -
quit docker:
exit -
preview your modified version of the website using your prefered web browser.
To build CNERG website using docker you can use the cnerg container containing
all the required dependencies to build the website
cnerg/cnerg.github.io-deps.
This is separated into two steps since this is easier than making your git config info available inside the docker container.
From the directory containing the website repository (if you don't have one yet please clone it first):
-
run the docker container:
docker run -u $UID -v $PWD:/local_drive -it cnerg/cnerg.github.io-deps -
go into the mounted folder in docker:
cd /local_drive -
stage the updated website for publication
make docker-gh-stage -
quit docker:
exit -
publish the updated website
make docker-gh-push