hugo-book icon indicating copy to clipboard operation
hugo-book copied to clipboard

noob errors shortcode at first installation (as a submodule)

Open evanescente-ondine opened this issue 2 years ago • 8 comments

Hi, I found this theme to be exactly what I wanted minus a few stylistic details, but I'm completely helpless in web management. I wanted to dowload your demo and figure out with the exemple where goes what, so I did the procedure to install from scratch (hugo new site mydocs; cd mydocs; git init; git submodule add https://github.com/alex-shpak/hugo-book themes/hugo-book; cp -R themes/hugo-book/exampleSite/content .), but I got errors I don't understand, with shortcodes or whatnot. I suppose I just miss a few libraries, as usual.

Thanks for your wonderful theme.

Details ~/D/A/M/Y/my_blog_en (master)> git submodule add https://github.co m/alex-shpak/hugo-book themes/hugo-book

Clonage dans '/home/drm/Documents/Autres_recherches_historiques_ou_genetique/Mes_propres_textes/Youtube/my_blog_en/themes/hugo-book'... remote: Enumerating objects: 4070, done. remote: Counting objects: 100% (23/23), done. remote: Compressing objects: 100% (18/18), done. remote: Total 4070 (delta 2), reused 13 (delta 1), pack-reused 4047 Réception d'objets: 100% (4070/4070), 6.24 Mio | 921.00 Kio/s, fait. Résolution des deltas: 100% (2086/2086), fait.

~/D/A/M/Y/my_blog_en (master)> hugo server --minify --theme hugo-b ook

Start building sites … hugo v0.101.0+extended linux/amd64 BuildDate=unknown

               | EN  

-------------------+----- Pages | 7
Paginator pages | 0
Non-page files | 0
Static files | 78
Processed images | 0
Aliases | 2
Sitemaps | 1
Cleaned | 0

Built in 291 ms Watching for changes in /home/drm/Documents/Autres_recherches_historiques_ou_genetique/Mes_propres_textes/Youtube/my_blog_en/{archetypes,content,data,layouts,static,themes} Watching for config changes in /home/drm/Documents/Autres_recherches_historiques_ou_genetique/Mes_propres_textes/Youtube/my_blog_en/config.toml Environment: "development" Serving pages from memory Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender Web Server is available at http://localhost:1313/ (bind address 127.0.0.1) Press Ctrl+C to stop

~/D/A/M/Y/my_blog_en (master)> cp -R themes/hugo-book/exampleSite/ content .

~/D/A/M/Y/my_blog_en (master)> hugo server --minify --theme hugo-b ook

Start building sites … hugo v0.101.0+extended linux/amd64 BuildDate=unknown WARN 2022/07/14 10:55:12 Expand shortcode is deprecated. Use 'details' instead. Error: Error building site: "/home/drm/Documents/Autres_recherches_historiques_ou_genetique/Mes_propres_textes/Youtube/my_blog_en/content/docs/shortcodes/mermaid.md:14:1": failed to render shortcode "columns": failed to process shortcode: "/home/drm/Documents/Autres_recherches_historiques_ou_genetique/Mes_propres_textes/Youtube/my_blog_en/themes/hugo-book/layouts/shortcodes/columns.html:4:12": execute of template failed: template: shortcodes/columns.html:4:12: executing "shortcodes/columns.html" at <$.Page.RenderString>: error calling RenderString: "/home/drm/Documents/Autres_recherches_historiques_ou_genetique/Mes_propres_textes/Youtube/my_blog_en/content/docs/shortcodes/mermaid.md:3:13": unrecognized character in shortcode action: U+005B '['. Note: Parameters with non-alphanumeric args must be quoted Built in 790 ms [/details]

evanescente-ondine avatar Jul 14 '22 10:07 evanescente-ondine

Hi! There is and unsolved nesting issues in shortcodes at the moment. https://github.com/alex-shpak/hugo-book/issues/452

It happens when shortcode is nested in another shortcode. Before fix either:

  1. install pre 0.100 version of hugo
  2. delete nested shortcode in mermaid/katex pages

It turned to be not easy to fix :)

alex-shpak avatar Jul 14 '22 10:07 alex-shpak

delete nested shortcode in mermaid/katex pages

Sure ? How do I do ? What would it change ? thanks for your quick response, for once I'm not to blame...

Do I just remove themes/hugo-book/static/katex plus themes/hugo-book/layouts/shortcodes/katex.html plus myblog_en/content/docs/shortcodes/katex.md?

evanescente-ondine avatar Jul 14 '22 10:07 evanescente-ondine

https://github.com/alex-shpak/hugo-book/blob/master/exampleSite/content/docs/shortcodes/mermaid.md?plain=1#L14 In this file delete lines 14, 28, 41

And in https://github.com/alex-shpak/hugo-book/blob/master/exampleSite/content/docs/shortcodes/katex.md?plain=1 lines 6, 14, 20

alex-shpak avatar Jul 14 '22 10:07 alex-shpak

ok I did that (only the lines, not what was between), and erase the the column line in content/_index.md because it complained. Now it's:

~/D/A/M/Y/myblog_en (master)> hugo server Start building sites … hugo v0.101.0+extended linux/amd64 BuildDate=unknown Error: Error building site: "/home/drm/Documents/Autres_recherches_historiques_ou_genetique/Mes_propres_textes/Youtube/myblog_en/content/docs/shortcodes/section/_index.md:15:1": failed to extract shortcode: template for shortcode "section" not found Built in 19 ms

evanescente-ondine avatar Jul 14 '22 10:07 evanescente-ondine

hm, well, it works for me, do you have your code pushed to git somewhere? Perhaps not all templates were copied

alex-shpak avatar Jul 14 '22 11:07 alex-shpak

Huh, I repeated the steps and it works. Thanks. So the shortcode column does work but not nested... Ok. I wonder why Hugo or whoever designed them couldn't come up with a [column] tag instead of these notations alien to markdown but whatever, I ain't gonna use them much.

evanescente-ondine avatar Jul 15 '22 10:07 evanescente-ondine

yep, problem is with shortcodes inside of other shortcodes in versions 100+

alex-shpak avatar Jul 15 '22 10:07 alex-shpak

Look, by mistake I erased my repertory and had to repeat the steps. and it did again ! There's something wrong in that behavior, I need to understand where the shortcodes section and column are defined. no assets and not shortcodes.scss

ok I did that (only the lines, not what was between), and erase the the column line in content/_index.md because it complained. Now it's:

~/D/A/M/Y/myblog_en (master)> hugo server Start building sites … hugo v0.101.0+extended linux/amd64 BuildDate=unknown Error: Error building site: "/home/drm/Documents/Autres_recherches_historiques_ou_genetique/Mes_propres_textes/Youtube/myblog_en/content/docs/shortcodes/section/_index.md:15:1": failed to extract shortcode: template for shortcode "section" not found Built in 19 ms

evanescente-ondine avatar Jul 25 '22 10:07 evanescente-ondine