From 92b0f42be033cd9284bb2380a6de6c0b37cee17b Mon Sep 17 00:00:00 2001 From: Silberengel Date: Sat, 25 Apr 2026 20:58:02 +0200 Subject: [PATCH] more reformatting --- assets/styles/layout.css | 92 +++++++++++++++++++ src/Controller/FeaturedAuthorsController.php | 22 +---- src/Controller/SeoController.php | 2 +- src/Dto/FeaturedArticleCard.php | 11 +++ src/Entity/Article.php | 8 ++ src/Factory/ArticleFactory.php | 42 ++++++++- src/Repository/ArticleRepository.php | 4 +- src/Repository/FeaturedAuthorRepository.php | 19 ++++ src/Service/FeaturedAuthorListedRows.php | 45 +++++++++ .../Components/Organisms/FeaturedList.php | 4 +- src/Twig/SidebarFeaturedAuthorsExtension.php | 27 ++++++ templates/base.html.twig | 4 + templates/components/Molecules/Card.html.twig | 2 +- .../Organisms/FeaturedList.html.twig | 8 +- .../SidebarFeaturedAuthors.html.twig | 32 +++++++ templates/pages/article.html.twig | 10 +- translations/messages.en.yaml | 2 + 17 files changed, 297 insertions(+), 37 deletions(-) create mode 100644 src/Service/FeaturedAuthorListedRows.php create mode 100644 src/Twig/SidebarFeaturedAuthorsExtension.php create mode 100644 templates/components/Organisms/SidebarFeaturedAuthors.html.twig diff --git a/assets/styles/layout.css b/assets/styles/layout.css index d8c3a16..2054291 100644 --- a/assets/styles/layout.css +++ b/assets/styles/layout.css @@ -51,6 +51,98 @@ text-decoration: none; } +/* Left nav: featured authors (desktop only; same site logo as header when no Nostr picture) */ +.sidebar-featured-authors { + display: none; +} + +@media (min-width: 1025px) { + .sidebar-featured-authors { + display: block; + margin-top: 1.1rem; + padding-top: 0.9rem; + border-top: 1px solid var(--color-border); + } + + .layout > nav .sidebar-featured-authors a, + .layout > nav .sidebar-featured-authors a:hover { + color: inherit; + text-decoration: none; + } + + .sidebar-featured-authors__title { + margin: 0 0 0.55rem; + font-family: var(--font-family), sans-serif; + font-size: 0.68rem; + font-weight: 600; + letter-spacing: 0.07em; + text-transform: uppercase; + color: color-mix(in srgb, var(--color-text-mid) 72%, var(--color-bg) 28%); + line-height: 1.3; + } + + .sidebar-featured-authors__grid { + display: flex; + flex-wrap: wrap; + gap: 0.5rem 0.45rem; + align-content: flex-start; + list-style: none; + margin: 0; + padding: 0; + } + + .layout > nav .sidebar-featured-authors__item, + .sidebar-featured-authors__item { + margin: 0; + padding: 0; + list-style: none; + } + + .sidebar-featured-authors__link { + display: block; + border-radius: 50%; + line-height: 0; + } + + .sidebar-featured-authors__link:hover { + text-decoration: none; + } + + .sidebar-featured-authors__link:hover .sidebar-featured-authors__avatar { + box-shadow: 0 0 0 2px var(--color-secondary); + } + + .sidebar-featured-authors__link:focus-visible .sidebar-featured-authors__avatar, + .sidebar-featured-authors__link:focus-visible { + outline: 2px solid var(--color-focus-ring); + outline-offset: 2px; + } + + .sidebar-featured-authors__avatar { + display: block; + width: 40px; + height: 40px; + border-radius: 50%; + overflow: hidden; + background: var(--color-bg-light); + box-shadow: 0 0 0 1px var(--color-border); + } + + .sidebar-featured-authors__avatar img { + display: block; + width: 100%; + height: 100%; + object-fit: cover; + } + + .sidebar-featured-authors__avatar img[src*="favicon-96x96"] { + object-fit: contain; + object-position: center; + padding: 0.2rem; + box-sizing: border-box; + } +} + /* Only the app chrome in Header.html.twig (#site-header). A bare `header` rule also matched