Skip to content
Snippets Groups Projects
Commit c3e323b4 authored by Dmitri Naumov's avatar Dmitri Naumov Committed by GitHub
Browse files

Merge pull request #1883 from bilke/web-index

[web] Fixed index page.
parents 56c972ff 4c64a068
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@
}
@Book{Ericson:2004:RCD:1121584,
Title = {Real-Time Collision Detection (The Morgan Kaufmann Series in Interactive 3-D Technology) (The Morgan Kaufmann Series in Interactive 3D Technology)},
Title = {Real-Time Collision Detection (The Morgan Kaufmann Series in Interactive 3-D Technology)},
Author = {Ericson, Christer},
Publisher = {Morgan Kaufmann Publishers Inc.},
Year = {2004},
......@@ -90,6 +90,16 @@
Url = {http://www.sciencedirect.com/science/article/pii/S0045794902004157}
}
@book{Kolditz2012,
title = "Thermo-Hydro-Mechanical-Chemical Processes in Porous Media - Benchmarks and Examples",
author = "{Kolditz}, O. and {G{\"o}rke}, U.-J. and Shao, H. and Wang, W.",
publisher = "Springer",
year = "2012",
volume = "86",
doi = "10.1007/978-3-642-27177-9",
isbn = "978-3-642-27176-2"
}
@article{Parisio2017,
title = "Plastic-damage modeling of saturated quasi-brittle shales ",
journal = "International Journal of Rock Mechanics and Mining Sciences ",
......
......@@ -52,6 +52,7 @@ find_program(NPM npm)
find_program(YARN yarn)
find_program(PIP pip)
find_package(PythonInterp)
find_program(PANDOC_CITEPROC pandoc-citeproc)
find_program(MODULE_CMD modulecmd
PATHS /usr/local/modules/3.2.10-1/Modules/3.2.10/bin)
......
......@@ -30,6 +30,13 @@ else()
message(STATUS "[web] Skipping import from Contentful!")
endif()
if(PANDOC_CITEPROC)
add_custom_target(web-bib-convert
COMMAND ${PANDOC_CITEPROC} --bib2json ${PROJECT_SOURCE_DIR}/Documentation/bibliography.bib > ${PROJECT_SOURCE_DIR}/web/data/bibliography.json
)
set(BIB_CONVERT_TARGET web-bib-convert)
endif()
if(DEFINED OGS_WEB_BASE_URL)
set(HUGO_ARGS --baseURL ${OGS_WEB_BASE_URL})
endif()
......@@ -41,7 +48,7 @@ endif()
add_custom_target(web
COMMAND ${NPM} run build:release -- ${HUGO_ARGS}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/web
DEPENDS web-install ${IMPORT_TARGET}
DEPENDS web-install ${IMPORT_TARGET} ${BIB_CONVERT_TARGET}
)
add_custom_target(web-clean
......
......@@ -12,5 +12,8 @@ yarn-error.log
# Generated from Contentful
content/internal
data/news.json
data/bibliography.json
import/c
# Generated by other tools
data/news.json
......@@ -131,6 +131,19 @@ Run `npm run convert` to get a list of possible arguments.
Equations can be set with typical LaTeX syntax by using [MathJax](https://www.mathjax.org/). Blocks are defined by `$$` at the beginning and `$$` at the end of the block. Inline math uses one `$` as the delimiter. For more usage instructions see the [MathJax LaTeX help](http://docs.mathjax.org/en/latest/tex.html).
### Bibliography references
Bibliography items from *Documentation/bibliography.bib* can be referenced by
their id with the `bib`-shortcode:
```go
{{< bib id="Kolditz2012" >}}
```
When building the `web`-target the file *Documentation/bibliography.bib* is
converted to *web/data/bibliography.json* with the tool `pandoc-citeproc`. This
json-file is then used by the shortcode.
## Developer notes
When adding a new module with `yarn add` you have to manually rebuild node-sass:
......
......@@ -31,9 +31,8 @@ $$
\end{equation}
$$
The relative error between the numerical simulation and the analytical solution is 9.2 $\cdot$ 10\uexp{-13}.
Kolditz, Olaf, Uwe-Jens Görke, Hua Shao, and Wenqing Wang, eds. Thermo-hydro-mechanical-chemical processes in porous media: benchmarks and examples. Vol. 86. Springer Science & Business Media, 2012.
The relative error between the numerical simulation and the analytical solution is $9.2 \cdot 10^{-13}$.
## References
{{< bib id="Kolditz2012" >}}
{{ define "main" }}
<div class="col-xs-12">
<h2>docs</h1>
<div class="col-xs-4">
<h2>Content</h2>
<ul>
{{ range first 10 .Data.Pages }}
{{ if eq .Type "docs"}}
{{ range .Site.Sections }}
<li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
{{ end }}
{{ end }}
</ul>
<h2>pages</h1>
<ul>
{{ range .Data.Pages }}
{{ if eq .Type "page" }}
<li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
{{ end }}
{{ end }}
</ul>
<li><a href="/news">News</a></li>
</div>
<h2>Contentful</h2>
<ul>
<li><a href="/news">News</a></li>
</ul>
<div class="col-xs-8">
<h1>Benchmark documentation site</h1>
<p>For the moment this site contains just the <a href="/docs/benchmarks">➥ benchmark documentation</a> for <a href="https://github.com/ufz/ogs6">OpenGeoSys-6</a>.
</p>
</div>
{{ end }}
{{ if .Site.Data.bibliography }}
<p>
{{ $id := .Get "id" }}
{{ range where .Site.Data.bibliography "id" $id }}
{{ range .author }}
{{ .family }}, {{ .given}}
{{ end }}
({{ range .issued }}
{{ range . }}
{{ range . }}
{{.}}
{{ end }}
{{ end }}
{{ end }}):
<i>{{ .title }}</i>.
<!-- Workaround for keys with hyphens inside with index-function -->
{{ if isset . "container-title" }}{{ index . "container-title" }}{{ end }}
{{ if isset . "issue" }}{{ .issue }},{{ end }}
{{ if isset . "volume" }}vol. {{ .volume }},{{ end }}
{{ if isset . "page" }}p. {{ .page }},{{ end }}
{{ .publisher }}
{{ end }}
</p>
{{ else }}
{{ printf "Warning: Bibliography not converted! Missing bib id: "}}<code>{{.Get "id"}}</code>
{{ end }}
......@@ -10,7 +10,7 @@ const commonConfig = merge([
app: pkg.paths.src.js + 'app.js', // PATHS.app,
},
output: {
path: pkg.paths.dist.js,
path: __dirname + pkg.paths.dist.js,
filename: 'bundle.js'
},
module: {
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment