Skip to content

Add server_fqdn for matrix badge#36

Open
jeckersb wants to merge 1 commit intobootc-dev:mainfrom
jeckersb:fix-matrix-badge
Open

Add server_fqdn for matrix badge#36
jeckersb wants to merge 1 commit intobootc-dev:mainfrom
jeckersb:fix-matrix-badge

Conversation

@jeckersb
Copy link
Copy Markdown
Collaborator

Without this the badge current says "NOT FOUND" with a scary
red/orange background.

After this, the badge says "GUESTS NOT ALLOWED" with a much less scary
gray background. I think that's as good as it's going to get on the
Fedora matrix instance.

Signed-off-by: John Eckersberg jeckersb@redhat.com

Without this the badge current says "NOT FOUND" with a scary
red/orange background.

After this, the badge says "GUESTS NOT ALLOWED" with a much less scary
gray background.  I think that's as good as it's going to get on the
Fedora matrix instance.

Signed-off-by: John Eckersberg <jeckersb@redhat.com>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the index.html template to include the server_fqdn parameter in the Matrix badge URL, which likely corrects its display or linking. The reviewer suggests an improvement to extract the hardcoded values within the Matrix badge URL into config.toml variables for better maintainability and easier future updates.

<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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant