This is the source code implementing the ocaml.org website. Information here is relevant only to developers and content contributors. End-users of the website should simply visit the website, which is hosted at ocaml.org.
Note: if you just want to edit a page you do not need to follow the instructions below. Simply click on the pen in the top right corner of the page and you will be redirected to that page on GitHub where you can edit it and submit your changes without leaving your browser.
Dependencies can be installed by running make deps
, which runs the
necessary OPAM commands. See the opam
file for more information
on the required packages.
Note this is the only purpose of the opam
file. This repository
doesn't provide any resources intended for use in other projects, so
it is not provided as a package in any opam repository.
In addition to the above opam
packages, it is expected that the
following programs are available:
- bash
- curl
- rsync
- GNU make
The site consists only of static pages, so it can be built and run entirely on a local machine without dependencies on external file or database servers. Simply run:
make
(or make -j
for a faster build on multicore machines.
NB: you might need to limit the number of forks e.g make -j 8
ref).
This will generate a new folder ocaml.org
that contains the full
website. Note that building the site will attempt to connect to the
Internet to download the news and latest email conversations. As
usual, use make clean
to delete the files generated by the
compilation.
site
— Main content of the site. Most files are in Markdown syntax
and converted to HTML by the build scripts.
template
— Templates governing the overall look and feel of the
site. These are applied to the pages within site/ when
the site is built. References to templates within site
pages should be of the form template/template-file-name
because the build script assumes this directory
structure.
script
— Scripts used to build the site.
For maintainers of the site, the following notes describe how the site is built and deployed:
Deploy: The site is currently deployed automatically using
ocurrent-deployer, which listens on the master
and staging
branches. The site is built using the Dockerfiles in
Dockerfile.deploy
and Dockerfile.staging
for each version of the site, and
pushed to https://ocaml.org and https://staging.ocaml.org/
Testing: If you wish to test a PR to see what it would look like live,
simply push the branch to the staging
branch of ocaml/ocaml.org.git and it
will rebuild. There is a web interface showing the status of the builds for
ocurrent-deployer.
The source code for the deployer can be found at
https://github.com/ocurrent/ocurrent-deployer in the src/pipeline.ml
.
For general discussion about the site's implementation, you can post to the OCaml discussion forum.
Check the CONTRIBUTING.md
file for more how to setup and start
contributing to the project.
For a specific bug report, content suggestion, or feature request, please create an issue on GitHub. Or best of all, fork the repo, make changes to your copy, and submit pull requests. It's that easy!