doks icon indicating copy to clipboard operation
doks copied to clipboard

Shortcode issues with hugo github action

Open james-s-w-clark opened this issue 1 year ago • 6 comments

Description

Run hugo --minify
WARN 2022/07/15 09:28:50 Module "project" is not compatible with this Hugo version; run "hugo mod graph" for more information.
Start building sites … 
hugo v0.101.0-[4](https://github.com/IdiosApps/doks-test/runs/7355365707?check_suite_focus=true#step:4:5)66fa43c16709b4483689930a4f9ac8add[5](https://github.com/IdiosApps/doks-test/runs/7355365707?check_suite_focus=true#step:4:6)c9f[6](https://github.com/IdiosApps/doks-test/runs/7355365707?check_suite_focus=true#step:4:7)6 linux/amd64 BuildDate=2022-06-16T0[7](https://github.com/IdiosApps/doks-test/runs/7355365707?check_suite_focus=true#step:4:8):09:16Z VendorInfo=gohugoio
Error: Error building site: "/home/runner/work/doks-test/doks-test/content/en/docs/prologue/quick-start.md:21:1": failed to extract shortcode: template for shortcode "details" not found
Total in 17 ms
Error: Process completed with exit code 255.

I made the site with https://getdoks.org/docs/tutorial/start-new-project/, and set up the git repo like https://getdoks.org/docs/tutorial/deploy-your-site/ I got the same error for alerts. So I deleted them. I don't know how many shortcodes it will fail to find.

The hugo minify command is OK locally. This might be an issue with the github action?

Steps to reproduce

See above. Failed logs at https://github.com/IdiosApps/doks-test/pull/3

Expected result

hugo --minify should be OK, just like local run

Are there some missing shortcodes in the layout folder? https://github.com/h-enk/doks/tree/master/layouts has layouts https://github.com/h-enk/doks-child-theme/tree/master/layouts does not have layouts image

If shortcodes are not included in the child theme layout, should the child theme use shortcodes in document files?

james-s-w-clark avatar Jul 15 '22 09:07 james-s-w-clark

Just seen https://github.com/h-enk/doks-gh-pages so I realise the github action for pushing to gh-pages branch should use npm, not hugo. However, the above example repo has a layouts folder with shortcodes. So I think the possible issue is still there

james-s-w-clark avatar Jul 15 '22 10:07 james-s-w-clark

I believe this shortcode is delivered via NPM. So while it's possible, I don't experience this with netlify so it's more likely the NPM issue.

james-d-elliott avatar Jul 17 '22 21:07 james-d-elliott

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Aug 17 '22 00:08 github-actions[bot]

WARN 2022/07/15 09:28:50 Module "project" is not compatible with this Hugo version; run "hugo mod graph" for more information.

Look like you tried to use Doks as a Hugo module (that won't work). Could you try running npm run build (in stead of hugo --minify)?

And could you try with this workflow: https://github.com/h-enk/doks-gh-pages/blob/master/.github/workflows/deploy-github.yml

h-enk avatar Aug 18 '22 16:08 h-enk

I will also test it locally + get back to you

h-enk avatar Aug 18 '22 16:08 h-enk

I don't have the time to check for now, but I think I was using the Hugo documentations GHA example at first - which used Hugo commands

I think I deleted the shortcodes and then switched to the Doks npm GHA example, so from memory i can't say whether the issue should be closed due to human error.

james-s-w-clark avatar Aug 18 '22 16:08 james-s-w-clark