Added "new" indicator to sidebar
Update sidebar.yml, commons.yml, and 4 more files...
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
abs_href: "/"
|
abs_href: "/"
|
||||||
icon: fad fa-home
|
icon: fad fa-home
|
||||||
active_id: home
|
active_id: home
|
||||||
|
has_new_until_utc: 0
|
||||||
|
|
||||||
-
|
-
|
||||||
|
|
||||||
@@ -9,6 +10,7 @@
|
|||||||
abs_href: "/articles/"
|
abs_href: "/articles/"
|
||||||
icon: fad fa-newspaper
|
icon: fad fa-newspaper
|
||||||
active_id: articles
|
active_id: articles
|
||||||
|
has_new_until_utc: 0
|
||||||
|
|
||||||
-
|
-
|
||||||
|
|
||||||
@@ -16,31 +18,37 @@
|
|||||||
abs_href: "/content/?tags=application;web"
|
abs_href: "/content/?tags=application;web"
|
||||||
icon: fad fa-browser
|
icon: fad fa-browser
|
||||||
active_id: application
|
active_id: application
|
||||||
|
has_new_until_utc: 0
|
||||||
|
|
||||||
- title_key: text.libraries
|
- title_key: text.libraries
|
||||||
abs_href: "/content/?tags=library"
|
abs_href: "/content/?tags=library"
|
||||||
icon: fad fa-puzzle-piece
|
icon: fad fa-puzzle-piece
|
||||||
active_id: library
|
active_id: library
|
||||||
|
has_new_until_utc: 0
|
||||||
|
|
||||||
- title_key: text.electronics
|
- title_key: text.electronics
|
||||||
abs_href: "/content/?tags=electronic"
|
abs_href: "/content/?tags=electronic"
|
||||||
icon: fad fa-microchip
|
icon: fad fa-microchip
|
||||||
active_id: electronic
|
active_id: electronic
|
||||||
|
has_new_until_utc: 0
|
||||||
|
|
||||||
- title_key: text.experiments
|
- title_key: text.experiments
|
||||||
abs_href: "/content/?tags=experiments"
|
abs_href: "/content/?tags=experiments"
|
||||||
icon: fad fa-flask-vial
|
icon: fad fa-flask-vial
|
||||||
active_id: electronic
|
active_id: electronic
|
||||||
|
has_new_until_utc: 0
|
||||||
|
|
||||||
- title_key: text.tools
|
- title_key: text.tools
|
||||||
abs_href: "/tools"
|
abs_href: "/tools"
|
||||||
icon: fad fa-toolbox
|
icon: fad fa-toolbox
|
||||||
active_id: tools
|
active_id: tools
|
||||||
|
has_new_until_utc: 0
|
||||||
|
|
||||||
- title_key: text.downloads
|
- title_key: text.downloads
|
||||||
raw_href: "https://files.nibblepoker.lu/"
|
raw_href: "https://files.nibblepoker.lu/"
|
||||||
icon: fad fa-download
|
icon: fad fa-download
|
||||||
active_id: ""
|
active_id: ""
|
||||||
|
has_new_until_utc: 1760986472
|
||||||
|
|
||||||
-
|
-
|
||||||
|
|
||||||
@@ -48,13 +56,16 @@
|
|||||||
abs_href: "/about"
|
abs_href: "/about"
|
||||||
icon: fad fa-user
|
icon: fad fa-user
|
||||||
active_id: about
|
active_id: about
|
||||||
|
has_new_until_utc: 0
|
||||||
|
|
||||||
- title_key: text.contact
|
- title_key: text.contact
|
||||||
abs_href: "/contact"
|
abs_href: "/contact"
|
||||||
icon: fad fa-mailbox
|
icon: fad fa-mailbox
|
||||||
active_id: ""
|
active_id: ""
|
||||||
|
has_new_until_utc: 0
|
||||||
|
|
||||||
- title_key: text.links
|
- title_key: text.links
|
||||||
abs_href: "/links"
|
abs_href: "/links"
|
||||||
icon: fad fa-link
|
icon: fad fa-link
|
||||||
active_id: links
|
active_id: links
|
||||||
|
has_new_until_utc: 0
|
||||||
|
@@ -21,3 +21,5 @@ user-agent: User-Agent
|
|||||||
server: Server
|
server: Server
|
||||||
|
|
||||||
cpu.architecture: Architecture de CPU
|
cpu.architecture: Architecture de CPU
|
||||||
|
|
||||||
|
python: Python
|
||||||
|
@@ -21,3 +21,5 @@ user-agent: User-Agent
|
|||||||
server: Serveur
|
server: Serveur
|
||||||
|
|
||||||
cpu.architecture: CPU Architecture
|
cpu.architecture: CPU Architecture
|
||||||
|
|
||||||
|
python: Python
|
||||||
|
@@ -12,7 +12,7 @@ text.libraries: Librairies
|
|||||||
text.electronics: Électronique
|
text.electronics: Électronique
|
||||||
text.experiments: Expériences
|
text.experiments: Expériences
|
||||||
text.3d-print: Impression 3D
|
text.3d-print: Impression 3D
|
||||||
text.tools: Outils
|
text.tools: Utilitaires
|
||||||
text.links: Liens
|
text.links: Liens
|
||||||
text.downloads: Téléchargements
|
text.downloads: Téléchargements
|
||||||
text.gitea: Dépôts Git
|
text.gitea: Dépôts Git
|
||||||
|
@@ -78,6 +78,9 @@
|
|||||||
<p class="t-size-18 t-w-500 py-xs sidebar-entry">
|
<p class="t-size-18 t-w-500 py-xs sidebar-entry">
|
||||||
<i class="{{ sidebar_entry.icon }} pr-xs t-size-12 t-half-muted"></i>
|
<i class="{{ sidebar_entry.icon }} pr-xs t-size-12 t-half-muted"></i>
|
||||||
<span class="t-size-12">{{ l10n(sidebar_entry.title_key, "sidebar", lang) }}</span>
|
<span class="t-size-12">{{ l10n(sidebar_entry.title_key, "sidebar", lang) }}</span>
|
||||||
|
{% if sidebar_entry.has_new() %}
|
||||||
|
<i class="fa-duotone fa-solid fa-sparkles ml-auto t-size-11 t-muted"></i>
|
||||||
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
|
from datetime import datetime, timezone
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
@@ -9,9 +10,13 @@ class SidebarEntry:
|
|||||||
title_key: str
|
title_key: str
|
||||||
icon: str
|
icon: str
|
||||||
active_id: str
|
active_id: str
|
||||||
|
has_new_until_utc: int
|
||||||
abs_href: Optional[str] = field(default=None)
|
abs_href: Optional[str] = field(default=None)
|
||||||
raw_href: Optional[str] = field(default=None)
|
raw_href: Optional[str] = field(default=None)
|
||||||
|
|
||||||
|
def has_new(self) -> bool:
|
||||||
|
return datetime.fromtimestamp(self.has_new_until_utc, tz=timezone.utc) > datetime.now(timezone.utc)
|
||||||
|
|
||||||
|
|
||||||
__SIDEBAR_ENTRIES: list[Optional[SidebarEntry]] = list()
|
__SIDEBAR_ENTRIES: list[Optional[SidebarEntry]] = list()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user