HUGO

How to add assets from 3rd party Hugo module

I’m working on an event site and want to add TND add-to-call module https://github.com/theNewDynamic/hugo-module-tnd-addtocal

It’s written in README that I need to add {{ partial "tnd-addtocal/add" . }} to add the calendar button. It works ok.
But then I supposed to add {{ partial "tnd-addtocal/assets" . }} in order to have the button functionality and icons. But wherever I’m trying to add this line of code it breaks my app.
The error:

Failed to render pages: render of "section" failed: execute of template failed: template: events/list.html:3:8: executing "events/list.html" at <partial "head.html" .>: error calling partial: "/home/magda/projects-2021/bitbetter.club/hugo-version/themes/basic/layouts/partials/head.html:36:5": execute of template failed: template: partials/head.html:36:5: executing "partials/head.html" at <partial "tnd-addtocal/assets" .>: error calling partial: partial "tnd-addtocal/assets" not found

I’m quite new to Hugo, so I simply don’t know how to add assets from the module.

As I’m reading more, I think that I should somehow mount the assets from the module but still not sure how to do it.
I’m trying to do it like this:

[module]

[[module.imports]]
path="github.com/theNewDynamic/hugo-module-tnd-addtocal"

[[module.mounts]]
source="assets/js"
target="static/js"

but without luck.

The README was out of date, just fixed it. You should actually use tnd-addtocal/tags and not /assets… Sorry about that.

Thank you for the reply. I changed this line and now at least it doesn’t break the whole app but there’s still an error in button.js
The toggle is opened all the time and there are no icons.

@regis One more question. I don’t exactly understand what it means by Also, be sure the following partial is called (only once) on any page with the calendar button. It will add the button styles and scripts:
I added this ```
{{ partial “tnd-addtocal/tags” . }}

in head.html. But should I add it in events/single.html instead? In the same file where I added the button?

What about css part of your assets? Shouldn’t it be attached? How the button.js can work if there aren’t css for class “hidden” or “active”?

What it means is it you should not have the module print its tags twice on the same page. (and load its script twice)

You can open an issue on the repo, in the mean time, adding .hidden { display: none} to your css will do.

Yes, I did overwrite this part of CSS.
Sorry for bothering you again, but should it display google calendar, apple and other icons from the icons folder or I need to add them somehow myself?

no icons, just strings

So you mean that the icons from partials/private/icons are not used in the project?