thegeeklab / hugo-geekdoc

Hugo theme made for documentation
https://geekdocs.de
MIT License
516 stars 315 forks source link

hugo command is working in local environement but shows errors with jenkins #35

Closed mahmoudozil closed 3 years ago

mahmoudozil commented 3 years ago

Capture

Is there a difference between environments when webuild the hugo project?

mahmoudozil commented 3 years ago

executing "partials/head.html" at <index .Site.Data.assets "main.min.css">: error calling index: index of untyped nil

what's the meaning of this

xoxys commented 3 years ago

In general the environment doesn't matter. At least I'm not aware of any limitations. The error message indicates you are using a git clone instead of a release tarball download. It means that compiles assets are not found. That's mostly the case if you use a git clone as source, see https://geekdocs.de/usage/getting-started/#install-requirements

tl;dr

If you want to use the theme from a cloned branch instead of a release tarball you’ll need to install gulp locally and run the default pipeline once to create all required assets.

mahmoudozil commented 3 years ago

it works thank you. The problem like you said i used git clone for master instead of a release.

alecthegeek commented 3 years ago

I have this problem as well however,...

I tried with a release install and a GitHub clone + gulp. But no difference.

It all builds nicely with a docker image on my desktop, so not sure what the difference is

xoxys commented 3 years ago

I've no idea so far. Do you use the same Hugo version locally and on Jenkins? Can you post the exact error output during the Jenkins run? Usually the environment does not really matter for Hugo builds.

ebuildy commented 3 years ago

@alecthegeek make sure in config.toml , theme is the right folder.

osallou commented 3 years ago

I have same issue with github actions. Works like a charm locally, with same hugo version

Build error link: https://github.com/bgo-bioimagerie/platformmanager/runs/3321956980?check_suite_focus=true

xoxys commented 3 years ago

@osallou Please dont hijack already closed issues in the future. Regarding your issue, it doesn't work locally as well:

git clone https://github.com/bgo-bioimagerie/platformmanager
Klone nach 'platformmanager' ...
remote: Enumerating objects: 12919, done.
remote: Counting objects: 100% (3051/3051), done.
remote: Compressing objects: 100% (1495/1495), done.
remote: Total 12919 (delta 2072), reused 2224 (delta 1493), pack-reused 9868
Empfange Objekte: 100% (12919/12919), 15.42 MiB | 9.51 MiB/s, fertig.
Löse Unterschiede auf: 100% (8679/8679), fertig.
[~/.tmp] $ cd platformmanager/doc
[~/.tmp/platformmanager/doc] $ hugo server
Start building sites … 
ERROR 2021/08/13 14:59:22 render of "page" failed: execute of template failed: template: _default/single.html:9:7: executing "_default/single.html" at <partial "head/others" .>: error calling partial: "/home/rknet/rkau2905/.tmp/platformmanager/doc/themes/hugo-geekdoc/layouts/partials/head/others.html:1:16": execute of template failed: template: partials/head/others.html:1:16: executing "partials/head/others.html" at <index .Site.Data.assets "js/darkmode.min.js">: error calling index: index of untyped nil
ERROR 2021/08/13 14:59:22 render of "page" failed: execute of template failed: template: _default/single.html:9:7: executing "_default/single.html" at <partial "head/others" .>: error calling partial: "/home/rknet/rkau2905/.tmp/platformmanager/doc/themes/hugo-geekdoc/layouts/partials/head/others.html:1:16": execute of template failed: template: partials/head/others.html:1:16: executing "partials/head/others.html" at <index .Site.Data.assets "js/darkmode.min.js">: error calling index: index of untyped nil
ERROR 2021/08/13 14:59:22 render of "page" failed: execute of template failed: template: _default/single.html:9:7: executing "_default/single.html" at <partial "head/others" .>: error calling partial: "/home/rknet/rkau2905/.tmp/platformmanager/doc/themes/hugo-geekdoc/layouts/partials/head/others.html:1:16": execute of template failed: template: partials/head/others.html:1:16: executing "partials/head/others.html" at <index .Site.Data.assets "js/darkmode.min.js">: error calling index: index of untyped nil
ERROR 2021/08/13 14:59:22 render of "page" failed: execute of template failed: template: _default/single.html:9:7: executing "_default/single.html" at <partial "head/others" .>: error calling partial: "/home/rknet/rkau2905/.tmp/platformmanager/doc/themes/hugo-geekdoc/layouts/partials/head/others.html:1:16": execute of template failed: template: partials/head/others.html:1:16: executing "partials/head/others.html" at <index .Site.Data.assets "js/darkmode.min.js">: error calling index: index of untyped nil
Built in 42 ms

You have not installed the theme properly, as e.g. the data directory is missing inside the themes/hugo-geekdoc/ folder.

[~/.tmp/platformmanager/doc] $ tree -L 1 themes/hugo-geekdoc/
themes/hugo-geekdoc/
├── archetypes
├── assets
├── images
├── layouts
├── LICENSE
├── README.md
├── static
├── theme.toml
└── VERSION

5 directories, 4 files

[~/.tmp/platformmanager/doc] $ tree -L 1 ~/Downloads/hugo-geekdoc
├── archetypes
├── assets
├── data
├── images
├── layouts
├── LICENSE
├── README.md
├── static
├── theme.toml
└── VERSION

6 directories, 4 files
xoxys commented 3 years ago

@osallou I've noticed that you use --minify in your GH Action, please read the docs https://geekdocs.de/usage/getting-started/#known-limitations

osallou commented 3 years ago

oops really sorry, did not see the close, other comments were added after the "close" event. and thanks for info

xoxys commented 3 years ago

No worries 🙂

Frederic168 commented 3 years ago

I got similar problem, when I deploy static we app on Azure image

xoxys commented 3 years ago

Please use GitHub discussions instead of hijacking closed issues.