Skip to content

Commit

Permalink
New pill in user doc (#303)
Browse files Browse the repository at this point in the history
* "new" pill in the ToC (#2394)

* Mark higher-level nodes with "New" pill as well, not only the actual item (#2429)

* Mark higher-level nodes with "New pill", not only the actual item

* Before review

* Update docs/js/custom.js

Co-authored-by: Dariusz Szut <[email protected]>

* Applied review suggestion

Co-authored-by: Adrien Dupuis <[email protected]>

---------

Co-authored-by: Dariusz Szut <[email protected]>
Co-authored-by: Adrien Dupuis <[email protected]>

* Added hidden CSS styling

* Marked Ibexa Engage as new

---------

Co-authored-by: Adrien Dupuis <[email protected]>
Co-authored-by: Dariusz Szut <[email protected]>
  • Loading branch information
3 people committed Jul 17, 2024
1 parent f10ae1a commit f69a3f8
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
4 changes: 4 additions & 0 deletions docs/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -605,3 +605,7 @@ div.path {
.path p.description {
color: var(--ibexa-dusk-black);
}

[hidden] {
display: none !important;
}
7 changes: 7 additions & 0 deletions docs/css/navigation.css
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@
padding-bottom: 0.5rem;
}

.md-nav__link .pill.new {
margin-right: 15px;
background-color: #d9e8ff;
color: #3562a0;
text-transform: lowercase;
}

.md-nav__link::after {
font-weight: 700;
}
Expand Down
1 change: 1 addition & 0 deletions docs/ibexa_engage/ibexa_engage.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
description: Ibexa Engage helps engage audiences and collect valuable data by using interactive content.
month_change: true
---

# Ibexa Engage
Expand Down
3 changes: 3 additions & 0 deletions docs/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,7 @@ $(document).ready(function() {
document.location.hash = event.target.hash;
}, 500);
});

// Mark higher-level nodes with "New" pill, not only the actual item
$(".pill.new:not([hidden])").parents(".md-nav__item").children('label').children(".pill.new[hidden]").removeAttr('hidden');
});
6 changes: 4 additions & 2 deletions theme/partials/nav-item.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% set checked = "checked" if nav_item.active %}
<input class="md-nav__toggle md-toggle" data-md-toggle="{{ path }}" type="checkbox" id="{{ path }}" {{ checked }}>
<label class="md-nav__link level-{{ level }}" for="{{ path }}">
{{ nav_item.title }}
{{ nav_item.title }} <span class="pill new" hidden>New</span>
</label>
<nav class="md-nav" aria-label="{{ nav_item.title }}" data-md-level="{{ level }}">
<label class="md-nav__link-title md-nav__link level-{{ level }}" for="{{ path }}">
Expand All @@ -16,7 +16,7 @@
<ul class="md-nav__list" data-md-scrollfix>
{% set base = path %}
{% for nav_item in nav_item.children %}
{% set path = base ~ "-" ~ loop.index %}
{% set path = base ~ "-" ~ loop.index %}
{% set level = level + 1 %}
{% include "partials/nav-item.html" %}
{% endfor %}
Expand All @@ -37,6 +37,7 @@
{% endif %}
<a href="{{ nav_item.url | url }}" class="md-nav__link level-{{ level }} md-nav__link--active">
{{ nav_item.title }}
{% if nav_item.meta.month_change %}<span class="pill new">New</span>{% endif %}
</a>
{% if toc | first is defined %}
{% include "partials/toc.html" %}
Expand All @@ -46,6 +47,7 @@
<li class="{{ class }}">
<a href="{{ nav_item.url | url }}" class="md-nav__link level-{{ level }}">
{{ nav_item.title }}
{% if nav_item.meta.month_change %}<span class="pill new">New</span>{% endif %}
</a>
</li>
{% endif %}

0 comments on commit f69a3f8

Please sign in to comment.