Partials: Naming Conventions

I am loading two Themes A and B. Both are using partials. No problems because all is under my control.
However this leads me to the following question:
When I would include a 3rd-Party Theme (module) that includes a partial C that has the same name as my own partials: Is this a problem at all or does the Hugo framework take care for scope on theme levels? (I slightly remember that I have read that partial names are always global - wrong?)
When this really might become an issue: What about naming conventions? What is the best practice to name partials in way, that we will not produce naming-conflicts when loading from several theme-modules?
Maybe I have not understood the theme-module concept at all. When yes, pls. advice for the details I am missing.

There is no magic scoping by Hugo (I think there was a discussion about this, esp. for config params).

So, as a theme user/author you have 2 options:

  1. Make sure your names are unique, e.g. by putting them in a folder/namespace, e.g. partials/mycomponent/foo.html.
  2. Mount the component into a namespace.

I’ve been using the last option lately when mounting non-Hugo projects (e.g. Bootstrap’s SCSS and JS files); mount them into /assets/scss/bootstrap etc.

1 Like

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