Skip to content
Snippets Groups Projects
Commit a02d621a authored by Lars Bilke's avatar Lars Bilke
Browse files

[web] Added a prj check to the data-link shortcode.

Requires prj files to be given as array, e.g:
project = ["project1.prj", "project2.prj"]

and a symlink of Tests into web (super ugly) as hugo cannot access files
outside of its working directory.
parent 17b1e81d
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,8 @@ preview web site:
# HACK to easier linking to the generated pages
- echo '<meta http-equiv="REFRESH" content="0;URL=web/public/index.html">' >> WebPreview.html
- cd web
# Symlink for prj link checks (data-link shortcode)
- ln -s ../Tests .
- yarn
- yarn build
rules:
......
{{ if .Get 1 }}
<a href="https://gitlab.opengeosys.org/ogs/ogs/-/blob/master/Tests/Data/{{ .Get 1 }}">
{{ else }}
<a href="https://gitlab.opengeosys.org/ogs/ogs/-/blob/master/Tests/Data/{{ .Page.Params.project }}">
{{ end }}
<i class="far fa-arrow-right"></i>
{{ if .Get 0 }}
{{ .Get 0 | markdownify }}
{{ else }}
Project file on GitLab
{{ end }}
</a>
{{ $prj_file := "" }}
<ul>
{{ with .Page.Params.project }}
{{ range . }}
{{ if os.FileExists "Tests" }}
{{ $filePath := print "Tests/Data/" .}}
{{ if os.FileExists $filePath }}
{{ else }}
{{ errorf "%q: Project file does not exist: %q" $.Page.File.Path . }}
{{ end }}
{{ end }}
<li>
<a href="https://gitlab.opengeosys.org/ogs/ogs/-/blob/master/Tests/Data/{{ . }}">
<i class="far fa-arrow-right"></i>
{{ . }}
</a>
</li>
{{ end }}
{{ end }}
</ul>
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