Closed musm closed 5 years ago
If you use Git to clone an Academic Kickstart repo created by Netlify, you will also need to use Git to init the Git submodule (Academic theme) or you will have a folder of website content without Academic itself installed.
The relevant steps are documented in the Installation Guide at https://github.com/gcushen/hugo-academic#install-with-git
git submodule update --init --recursive
I had a similar issue:
Building sites … ERROR 2020/05/14 21:04:45 Unable to locate template for shortcode "alert" in page "home/demo.md" ERROR 2020/05/14 21:04:45 Unable to locate template for shortcode "alert" in page "home/publications.md" Total in 15 ms Error: Error building site: logged 2 error(s)
I ran the submodule update have checked that the theme is copied: ./My_Website/themes/academic Is not empty.
I'm not sure what to try next
I've also managed to find the shortcode that hugo was unable to find:
I am also getting the unable to locate template for shortcode error:
Building sites … ERROR 2020/05/15 01:07:27 Unable to locate template for shortcode "fragment" in page "slides/example/index.md"
ERROR 2020/05/15 0Building sites … ERROR 2020/05/15 01:07:27 Unable to locate template for shortcode "fragment" in page "slides/example/index.md"
ERROR 2020/05/15 01:07:27 Unable to locate template for shortcode "alert" in page "publication/journal-article/index.md"
ERROR 2020/05/15 01:07:27 Unable to locate template for shortcode "alert" in page "post/writing-technical-content/index.md"
ERROR 2020/05/15 01:07:27 Unable to locate template for shortcode "alert" in page "publication/conference-paper/index.md"
ERROR 2020/05/15 01:07:27 Unable to locate template for shortcode "alert" in page "publication/preprint/index.md"
ERROR 2020/05/15 01:07:27 Unable to locate template for shortcode "gallery" in page "home/gallery/index.md"
Total in 48 ms
Error: Error building site: logged 6 error(s)
For future humans (on windows):
I didn't realize hugo and hugo extended were two different packages. What worked for me:
Note: I'm skipping some steps, but these were the ones that took me the most time. Also breaking changes may make these instructions obsolete. Good luck!
I didn't realize hugo and hugo extended were two different packages
This was my issue as well. I downloaded a binary of the latest release of hugo_extended and shortcodes now all resolve properly.
Thanks for the tip!
Have followed all the advice provided on this thread but still facing this exact issue after running hugo server -D
failed to extract shortcode: template for shortcode "alert" not found
All the academic theme data exists. Hugo is the latest version downloaded via homebrew.
Check if you have the extended
version of Hugo
:
hugo version
@rdbcasillas if you can link to your Github repo, the community can attempt to help you better. Generally, this error indicates that the Academic theme was not found and hence likely not installed to the location described in the installation guide.
You might wish to consider using the online installation wizard which will install Academic for you - https://sourcethemes.com/academic/docs/install/
I have exactly the same problem. Hugo via zip file extended for Win10. I also followed the installation instructions.
Hi @gcushen , thanks for responding. This error was occurring because I added the marketing info within the config.toml file instead of params.toml (I guess one line on this can be added in the google analytics section of the documentation). Once I fixed that, it went away. I think hugo's error descriptions aren't that great and can send you to a wild goose chase.
Anyway, thank you for creating (and maintaining) hugo-academic and being so responsive to the community!
I also have this issue. However I could publish it via netlify...
Same issue here on Mac. I created the website with the installation wizard a couple of weeks ago. Then I cloned it and it was running locally just fine with hugo server
. Today I wanted to update something and it stopped working with the error Error: Error building site: "/Users/piotr/Workspace/Webpages/resume-website/content/home/publications.md:70:1": failed to extract shortcode: template for shortcode "alert" not found
Solution
I had to update my go.mod and go.sum files in the repo root.
Same issue here on Mac. I created the website with the installation wizard a couple of weeks ago. Then I cloned it and it was running locally just fine with
hugo server
. Today I wanted to update something and it stopped working with the errorError: Error building site: "/Users/piotr/Workspace/Webpages/resume-website/content/home/publications.md:70:1": failed to extract shortcode: template for shortcode "alert" not found
Solution
I had to update my go.mod and go.sum files in the repo root.
Thanks for your help!
What do you mean for updating those files? I have reinstalled the Academic cloning the repository starter-academic
and I get the same error.
@matteodefelice I deleted the old content and added the new content of these files (from under the links).
Ok solved cleaning the cache as explained in https://discourse.gohugo.io/t/academic-theme-failed-to-extract-shortcode-template-for-shortcode-callout-not-found/28857
I fixed this issue by deleting the alert information noted on the publication page.
Reproduction:
Launched with netlify Git cloned github page from terminal ran
$ hugo server -D
--> Error building failed to extract shortcode: template for shortcode "alert" not found