Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve display of licenses link in topbar #2740

Merged
merged 1 commit into from
Feb 22, 2025
Merged
Show file tree
Hide file tree
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
22 changes: 11 additions & 11 deletions templates/rustdoc/topbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,23 @@
</a>
</li>

<li class="pure-menu-item">
<span class="pure-menu-text description">
{{ crate::icons::IconScaleUnbalancedFlip.render_solid(false, false, "") }}
{%- if let Some(parsed_licenses) = krate.parsed_license -%}
{%- for item in parsed_licenses -%}
{%- if let Some(parsed_licenses) = krate.parsed_license -%}
<li class="pure-menu-item">
<span class="pure-menu-link description">
{{- crate::icons::IconScaleUnbalancedFlip.render_solid(false, false, "") }}
{%+ for item in parsed_licenses -%}
{%- match item -%}
{%- when crate::web::licenses::LicenseSegment::Spdx with (license) -%}
{%- when crate::web::licenses::LicenseSegment::Spdx(license) -%}
<a href="https://spdx.org/licenses/{{ license|safe }}" class="pure-menu-sublink">{{ license }}</a>
{%- when crate::web::licenses::LicenseSegment::UnknownLicense with (license) -%}
{%- when crate::web::licenses::LicenseSegment::UnknownLicense(license) -%}
{{ license }}
{%- when crate::web::licenses::LicenseSegment::GlueTokens with (tokens) -%}
{%- when crate::web::licenses::LicenseSegment::GlueTokens(tokens) -%}
{{ tokens }}
{%- endmatch -%}
{%- endfor -%}
{%- endif -%}
</span>
</li>
</span>
</li>
{%- endif -%}
</ul>

<div class="pure-g menu-item-divided">
Expand Down
8 changes: 6 additions & 2 deletions templates/style/_navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,13 @@ div.nav-container {
outline: unset;
}

.docsrs-logo, .pure-menu-item a.pure-menu-link, .pure-menu-item .pure-menu-text {
.docsrs-logo, .pure-menu-item a.pure-menu-link, .pure-menu-item .pure-menu-text {
padding: 6.4px 16px 6.4px 16px;
}
}

.pure-menu-link, .pure-menu-text {
display: block;
}

.docsrs-logo, .pure-menu-item, .pure-menu-item a {
height: 100%;
Expand Down
Loading