In order to test the webpage locally:
python3 scripts/bibliography.py # generates the bibliography pages, see below
hugo serveThis prints the URL at which you can preview the webpage (minus some files that are only on the server and not in Git). When files are modified, there is a JavaScript that will reload the browser window.
See CONTRIBUTING.md for how to write pages.
To create a new page:
hugo new content/news/openmodelica-1.21.0.mdAnd then edit the template in a text editor.
The config.toml file contains parameters that can be used inside of articles. For example, it is possible to write code like:
Report bugs in [GitHub]({{< param "bugreporting" >}})There are also parameters for the release, stable and nightly versions that can be used to generate webpages.
The Download Statistics page shows /api/statistics.json.
That file is not in Git: the Jenkins job runs scripts/statistics.py before hugo, which reads the monthly
numbers from the AWStats of build.openmodelica.org and writes static/api/statistics.json.
- The numbers are the sum rows of the AWStats extra sections in
scripts/awstats/extra-sections.conf, which must be part of/etc/awstats/awstats.conf.localon the web server. - The AWStats login is the Jenkins username/password credential with the ID
awstats. - Pull requests, other branches and builds without the login reuse the published numbers.
To see the page locally with the published numbers:
python3 scripts/statistics.py
hugo serveThe pages of the journal papers, conference papers, PhD and licentiate theses, master theses and the whole
bibliography in the Research menu are generated from doc/bibliography/openmodelica.bib of the
OpenModelica repository, so add or change entries there.
Each page shows the entries of one BibTeX type (article, inproceedings, phdthesis, mastersthesis).
The pages are not in Git: the Jenkins job runs scripts/bibliography.py before hugo, which downloads
openmodelica.bib from the master branch and writes the pages to content/research/.
The Jenkins job of OpenModelica starts the website job when openmodelica.bib changed on master.
To see the pages locally:
python3 scripts/bibliography.py # or --bib path/to/openmodelica.bib
hugo serveThe Hugo templates (layouts/, themes/openmodelica/layouts/) and the theme stylesheets are formatted with
Prettier and the Go template plugin, with the settings in .prettierrc.json.
Page content is not formatted. A GitHub workflow checks the formatting of every pull request.
npm install
npm run format # format all files
npm run check-format # only checkPrettier breaks {{ if }}…{{ else }}…{{ end }} blocks inside attribute values onto several lines,
which puts line breaks into the value. Use a single action instead, for example
href="{{ .Params.external_url | default .RelPermalink }}".