Stack theme widgets not appearing

Hi there,

Sorry if this seems like an incredibly simple question, but I’m new to Hugo

I’m currently building my site using the Stack theme, and I’m trying to enable the various widgets for the right sidebar.

Looking at the documentation, [the starter repo]((hugo-theme-stack-starter/config/_default/params.toml at 77fe570b3a58053d94127488cb34b2adf65d0273 · CaiJimmy/hugo-theme-stack-starter · GitHub), and the file that forms the base template for the page it should be pulling through “.Site.Params.Widgets.Page” and looking for an entry with “type” as “toc”

In my hugo.toml I have:
[[widgets.page]]
type = “toc”

Yet, when outputting the params in the aforementioned page, the collection of site params is empty.

Does anyone know what I’m doing wrong? As far as I can tell I’m following the documentation correctly, but it could be a skill issue on my part.

mmh, when I create a fresh repo from the template there’s a setting in config/_default/params.toml

[[widgets.page]]
   type = "toc"

and I have a toc in the sidebar for pages and removing this setting will remove the toc. seems to work

there’s an issue in their tracker about no sidebar on mobile so if your browser window is not large enough the sidebar will just disappear.

displaying the site config seems not to be your target, but just a try to debug something.
I did not really understand what the problem is

  • what do you want
  • what do you get

In a roundabout way you’ve explained where I was going wrong - I needed to add those site params to a new file/folder structure (config/_default/params.toml) rather than adding them to the hugo.toml in the root (which I thought was setting the site params)

Yes, outputting the results of the collection was trying to debug, to see why the toc widget wasn’t displaying despite the params being set (in hugo.toml)

  • What did I want? To have the toc display
  • What did I get? The toc not displaying

But placing the params in that separate file (that I didn’t know needed to exist) resolved it.

that’s one of the standard way to configure hugo

for reference:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.