HugoBlox / hugo-blox-builder

🚨 GROW YOUR AUDIENCE WITH HUGOBLOX! 🚀 HugoBlox is an easy, fast no-code website builder for researchers, entrepreneurs, data scientists, and developers. Build stunning sites in minutes. 适合研究人员、企业家、数据科学家和开发者的简单快速无代码网站构建器。用拖放功能、可定制模板和内置SEO工具快速创建精美网站!
https://hugoblox.com/templates/
MIT License
8.36k stars 2.9k forks source link

failed to extract shortcode: template for shortcode "alert" not found #1034

Closed musm closed 5 years ago

musm commented 5 years ago

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

gcushen commented 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

gcushen commented 5 years ago

https://github.com/gcushen/hugo-academic#install-with-git

witignite commented 4 years ago
git submodule update --init --recursive
ymondal commented 4 years ago

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

ymondal commented 4 years ago

I've also managed to find the shortcode that hugo was unable to find: image

dishank-b commented 4 years ago

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)
ymondal commented 4 years ago

For future humans (on windows):

I didn't realize hugo and hugo extended were two different packages. What worked for me:

  1. Get git on windows (instructions floating around somewhere). git clone the website.
  2. Use this build of hugo: https://chocolatey.org/packages/hugo-extended

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!

ktmeaton commented 4 years ago

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!

rdbcasillas commented 4 years ago

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.

Bertbk commented 4 years ago

Check if you have the extended version of Hugo:

hugo version
gcushen commented 4 years ago

@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/

midi292 commented 4 years ago

I have exactly the same problem. Hugo via zip file extended for Win10. I also followed the installation instructions.

rdbcasillas commented 4 years ago

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!

LucQin commented 4 years ago

I also have this issue. However I could publish it via netlify...

piojanu commented 4 years ago

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.

luoyeguigenno1 commented 4 years ago

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.

Thanks for your help!

matteodefelice commented 4 years ago

What do you mean for updating those files? I have reinstalled the Academic cloning the repository starter-academic and I get the same error.

piojanu commented 4 years ago

@matteodefelice I deleted the old content and added the new content of these files (from under the links).

matteodefelice commented 4 years ago

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

portgasray commented 2 years ago

I fixed this issue by deleting the alert information noted on the publication page.