Add option to left-align subproject badges

This commit is contained in:
david-swift 2025-03-11 22:40:05 +01:00
parent 44b90cbfae
commit 9f538c804d
3 changed files with 12 additions and 2 deletions

View File

@ -113,6 +113,9 @@ show_backlinks = true
# Hide the tags in the subprojects list.
# hide_subproject_tags = true
#
# Left-align badges in the subprojects list.
# left_align_badges = true
#
# Whether to use Content Security Policy.
# Keep in mind that although this can potentially increase security,
# it can break some stuff, in which case you will need to set custom policy.

View File

@ -36,7 +36,14 @@
position: absolute;
z-index: 10;
margin: 20px;
right: 0;
background-color: var(--bg-color)
}
.badge:not(#left-align-badge) {
right: 0;
}
#left-align-badge {
left: 0;
}
}

View File

@ -7,7 +7,7 @@
<a href="{{ page.permalink | safe }}"></a>
{%- endif -%}
{% if page.extra.badge %}
<span class="badge subproject-badge">
<span id="{%- if config.extra.left_align_badges -%}left-align-badge{%- endif -%}" class="badge subproject-badge">
{{ page.extra.badge }}
</span>
{%- endif %}