From c635358078a19e09c05a16d8b8ebedf70a471d6b Mon Sep 17 00:00:00 2001
From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>
Date: Thu, 6 Jun 2024 13:48:03 +0200
Subject: [PATCH 1/4] "new" pill in the ToC (#2394)
---
docs/css/navigation.css | 7 +++++++
theme/partials/nav-item.html | 4 +++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/docs/css/navigation.css b/docs/css/navigation.css
index 7e654d43..d622a0e7 100644
--- a/docs/css/navigation.css
+++ b/docs/css/navigation.css
@@ -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;
}
diff --git a/theme/partials/nav-item.html b/theme/partials/nav-item.html
index af5e454d..43dffa58 100644
--- a/theme/partials/nav-item.html
+++ b/theme/partials/nav-item.html
@@ -16,7 +16,7 @@
{% 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 %}
@@ -37,6 +37,7 @@
{% endif %}
{{ nav_item.title }}
+ {% if nav_item.meta.month_change %}New{% endif %}
{% if toc | first is defined %}
{% include "partials/toc.html" %}
@@ -46,6 +47,7 @@
-
{{ nav_item.title }}
+ {% if nav_item.meta.month_change %}New{% endif %}
{% endif %}
From 4836b651003beee533aa716f3669df5152697284 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Noco=C5=84?=
Date: Mon, 15 Jul 2024 10:20:58 +0200
Subject: [PATCH 2/4] 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
* Applied review suggestion
Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>
---------
Co-authored-by: Dariusz Szut
Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>
---
docs/js/custom.js | 3 +++
theme/partials/nav-item.html | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/docs/js/custom.js b/docs/js/custom.js
index 96c528c5..9a68a3bc 100644
--- a/docs/js/custom.js
+++ b/docs/js/custom.js
@@ -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');
});
diff --git a/theme/partials/nav-item.html b/theme/partials/nav-item.html
index 43dffa58..c6c67dee 100644
--- a/theme/partials/nav-item.html
+++ b/theme/partials/nav-item.html
@@ -7,7 +7,7 @@
{% set checked = "checked" if nav_item.active %}