Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h3 class="title-text text-center">
</div>
<div class="text-center" style="padding-top: 10px;">
<a href="https://matrix.to/#/#bootc:fedoraproject.org">
<img src="https://img.shields.io/matrix/bootc%3Afedoraproject.org?label=%23bootc%3Afedoraproject.org&style=for-the-badge&logo=matrix">
<img src="https://img.shields.io/matrix/bootc%3Afedoraproject.org?server_fqdn=chat.fedoraproject.org&label=%23bootc%3Afedoraproject.org&style=for-the-badge&logo=matrix">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While this change correctly fixes the Matrix badge, the URL contains several hardcoded values. To improve maintainability, it's recommended to extract these values into variables in your config.toml file. This makes it easier to update them in one place if they ever change.

You could add the following to your config.toml under the [extra] section:

matrix_room_id = "#bootc:fedoraproject.org"
matrix_room_alias = "bootc:fedoraproject.org"
matrix_server_fqdn = "chat.fedoraproject.org"

Then, you can use these variables in the template. The suggestion below updates the <img> tag. For completeness, you should also update the <a> tag on line 18 to use config.extra.matrix_room_id.

            <img src="https://img.shields.io/matrix/{{ config.extra.matrix_room_alias | default(value='bootc:fedoraproject.org') | urlencode }}?server_fqdn={{ config.extra.matrix_server_fqdn | default(value='chat.fedoraproject.org') }}&label={{ config.extra.matrix_room_id | default(value='#bootc:fedoraproject.org') | urlencode }}&style=for-the-badge&logo=matrix">

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

complicated

</a>
&nbsp;
<a href="https://cloud-native.slack.com/archives/C08SKSQKG1L">
Expand Down