From b568c1aacd80d1d1f58be48292894f5bda20f6f7 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Sun, 26 Mar 2023 14:12:40 +0200 Subject: [PATCH 1/2] rm linebreak in shortcode use --- .../ref/sample/interference/other/approximation-ssca/index.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hugo/content/ref/sample/interference/other/approximation-ssca/index.md b/hugo/content/ref/sample/interference/other/approximation-ssca/index.md index 37d91b9c93b..711d08062c9 100644 --- a/hugo/content/ref/sample/interference/other/approximation-ssca/index.md +++ b/hugo/content/ref/sample/interference/other/approximation-ssca/index.md @@ -21,5 +21,4 @@ Scattering from cylinders of two different sizes using the Size-Spacing Coupling {{< figscg src="/img/auto/scatter2d/ApproximationSSCA.png" width="350px" caption="Intensity image">}} {{< /galleryscg >}} -{{< highlightfile -file="Examples/scatter2d/ApproximationSSCA.py" >}} +{{< highlightfile file="Examples/scatter2d/ApproximationSSCA.py" >}} -- GitLab From ad55df05265bf6f3d5cef98e69dd41d3abd1718b Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Sun, 26 Mar 2023 14:30:37 +0200 Subject: [PATCH 2/2] hugo: read examples from static/py/auto --- .gitignore | 1 + hugo/layouts/shortcodes/highlightfile.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 12d40a0f8be..30623a64a99 100644 --- a/.gitignore +++ b/.gitignore @@ -36,4 +36,5 @@ cover/ hugo/public hugo/resources hugo/static/img/auto +hugo/static/py/auto hugo/.* \ No newline at end of file diff --git a/hugo/layouts/shortcodes/highlightfile.html b/hugo/layouts/shortcodes/highlightfile.html index 6b3283b9ec8..d09641d9b1c 100644 --- a/hugo/layouts/shortcodes/highlightfile.html +++ b/hugo/layouts/shortcodes/highlightfile.html @@ -7,7 +7,7 @@ Argument 1 = File path below /src/ {{- $lang := .Get "language" | default ("python") }} {{- $opt := .Get "opt" | default ("linenos=table") }} -{{ $path := (printf "/src/%s" $src) }} +{{ $path := (printf "/py/auto/%s" $src) }} {{ $file := $path | readFile }} {{ highlight (print $file) $lang $opt}} -- GitLab