From d124f2a82d2ab6375ff421a654d11340826a0cf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nu=C5=A1a=20Puk=C5=A1i=C4=8D?= Date: Sun, 3 Aug 2025 12:01:49 +0200 Subject: [PATCH] Footer links --- assets/styles/app.css | 8 ++++++++ assets/styles/layout.css | 4 ++++ config/services.yaml | 7 +++++++ config/unfold.yaml | 9 +++++++-- docs/features.md | 1 + src/Twig/FooterLinksExtension.php | 25 +++++++++++++++++++++++++ templates/components/Footer.html.twig | 12 ++++++++++++ 7 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 src/Twig/FooterLinksExtension.php diff --git a/assets/styles/app.css b/assets/styles/app.css index e23e5a0..8694975 100644 --- a/assets/styles/app.css +++ b/assets/styles/app.css @@ -30,6 +30,8 @@ h1.brand { font-size: 3.6rem; } + + h1.brand a { color: var(--brand-color); } @@ -501,3 +503,9 @@ label.search { justify-content: center; margin-bottom: 15px; } + +@media (max-width: 600px) { + h1.brand { + font-size: 2.2rem; + } +} diff --git a/assets/styles/layout.css b/assets/styles/layout.css index 0076c36..50ed060 100644 --- a/assets/styles/layout.css +++ b/assets/styles/layout.css @@ -182,6 +182,10 @@ footer .footer-links { margin: 24px 0; } +.footer-links a { + color: var(--color-text-light); +} + .search input { flex-grow: 1; } diff --git a/config/services.yaml b/config/services.yaml index 354da0c..14f2457 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -6,6 +6,9 @@ imports: - { resource: unfold.yaml } +parameters: + footer_links: '%kernel.project_dir%/config/unfold.yaml' + services: # default configuration for services in *this* file _defaults: @@ -29,3 +32,7 @@ services: App\Service\NostrClient: arguments: $defaultRelayUrl: '%default_relay%' + App\Twig\FooterLinksExtension: + arguments: + $footerLinksPath: '%footer_links%' + tags: [ 'twig.extension' ] diff --git a/config/unfold.yaml b/config/unfold.yaml index 01abf9d..0fc4b9e 100644 --- a/config/unfold.yaml +++ b/config/unfold.yaml @@ -9,5 +9,10 @@ parameters: npub: 'npub1ez09adke4vy8udk3y2skwst8q5chjgqzym9lpq4u58zf96zcl7kqyry2lz' d_tag: 'unfold-magazine' community_articles: true - - + external_links: + - title: "Unfold" + url: "https://github.com/decent-newsroom/unfold" + description: "Project source code on GitHub." + - title: "Decent Newsroom" + url: "https://decentnewsroom.com/" + description: "Decentralized magazine platform." diff --git a/docs/features.md b/docs/features.md index 8bc7e2f..e648920 100644 --- a/docs/features.md +++ b/docs/features.md @@ -8,3 +8,4 @@ - Configurable magazine name and short name via YAML and .env - Theme selection (currently: purple) - Community articles feature (enable/disable via config) +- Configurable external footer links via YAML (unfold.yaml), available as a Twig global for easy template integration diff --git a/src/Twig/FooterLinksExtension.php b/src/Twig/FooterLinksExtension.php new file mode 100644 index 0000000..f4263d7 --- /dev/null +++ b/src/Twig/FooterLinksExtension.php @@ -0,0 +1,25 @@ +footerLinks = $config['parameters']['external_links'] ?? []; + } + + public function getGlobals(): array + { + return [ + 'footer_links' => $this->footerLinks, + ]; + } +} diff --git a/templates/components/Footer.html.twig b/templates/components/Footer.html.twig index 2226f22..45617dd 100644 --- a/templates/components/Footer.html.twig +++ b/templates/components/Footer.html.twig @@ -1 +1,13 @@ + +

{{ "now"|date("Y") }} {{ website_name }}

+