From b43d9fe2bbed161c9ebdb49c86353b5c78863913 Mon Sep 17 00:00:00 2001 From: Gabriele Musco Date: Sun, 10 Dec 2023 08:58:07 +0000 Subject: [PATCH] feat: doc pages can have icons shown before the title --- assets/_main.scss | 6 ++++++ layouts/partials/docs/title.html | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/assets/_main.scss b/assets/_main.scss index 7073e2b..826a06d 100644 --- a/assets/_main.scss +++ b/assets/_main.scss @@ -287,6 +287,12 @@ body[dir="rtl"] .book-menu { will-change: transform, margin, opacity; } +.book-filetree-icon { + width: 16px; + height: 16px; + vertical-align: middle; +} + @media screen and (max-width: $mobile-breakpoint) { #menu-control, #toc-control { diff --git a/layouts/partials/docs/title.html b/layouts/partials/docs/title.html index 83df5b6..19620bd 100644 --- a/layouts/partials/docs/title.html +++ b/layouts/partials/docs/title.html @@ -3,7 +3,11 @@ Accepts Page as context --> {{ $title := "" }} +{{ $icon := "" }} +{{ if .Params.Icon }} + {{ $icon = printf "" .Params.Icon }} +{{ end }} {{ if .LinkTitle }} {{ $title = .LinkTitle }} {{ else if .Title }} @@ -14,4 +18,5 @@ {{ $title = .File.BaseFileName | humanize | title }} {{ end }} -{{ return $title }} +{{ $out := printf "%s %s" $icon $title | safeHTML }} +{{ return $out }}