Dumb question: do I want to make a theme, plugin or component?

AI-generated summary

The user, pnoeric, seeks guidance on how to package changes to the user-card-contents.hbs file in Discourse, unsure whether to use a theme, plugin, or component. Canapin explains that a custom component can be created directly via the Discourse admin under Customize, using a script tag with the data-template-name attribute to override the template. Falco confirms that a theme component is the appropriate choice for modifying the .hbs file. pnoeric appreciates the advice, noting it provides the clarity needed to proceed.

I want to make some changes to the user card .hbs file:

https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/templates/components/user-card-contents.hbs

I can change this .hbs file but here’s what I can’t figure out: how exactly do I package it up in a way that it will be used in my Discourse? I can’t tell if needs to be part of a custom theme, or if I need to make a plugin (?!) or if I need to make a component (?!).

I am not asking someone else to do the work, and I’ve read up on how to develop themes and plugins and my head is swimming :wink: …I just need someone to “zoom out” a little bit and give me enough context and guidance so I can proceed.

You can create a new component directly from the discourse admin (in Customize) to override this file’s contents.

See: Developing Discourse Themes & Theme Components

In your new component, go to Custom HTML/CSS, and in </head>, put this:

<script type="text/x-handlebars" data-template-name="components/user-card-contents">
//Here goes all user-card-contents template code
</script>

If all you want is to change the hbs file, a theme component is the way to go.

Thank you both so much!! This is exactly what I needed.