diff --git a/assets/styles/app.css b/assets/styles/app.css index 0f8b5b2..135a567 100644 --- a/assets/styles/app.css +++ b/assets/styles/app.css @@ -41,6 +41,11 @@ h1.brand a { color: var(--brand-color); } +h1:not(.brand) > a:hover { + text-decoration: none; + font-weight: 500; +} + h2 { font-size: 2.2rem; } diff --git a/src/Twig/Components/Organisms/MagazineHero.php b/src/Twig/Components/Organisms/MagazineHero.php new file mode 100644 index 0000000..c4d94f1 --- /dev/null +++ b/src/Twig/Components/Organisms/MagazineHero.php @@ -0,0 +1,56 @@ + + */ + public function getCategoryTags(): array + { + $tags = []; + $magazine = $this->magazine; + + if ($magazine) { + $tags = $magazine->getTags(); + } + + if (!is_iterable($tags)) { + return []; + } + + // Filter: tag[0] === 'a' + $filtered = []; + foreach ($tags as $tag) { + if (is_array($tag) && isset($tag[0]) && $tag[0] === 'a') { + $filtered[] = $tag; + } + } + + return $filtered; + } +} diff --git a/templates/components/Organisms/MagazineHero.html.twig b/templates/components/Organisms/MagazineHero.html.twig new file mode 100644 index 0000000..23bbddd --- /dev/null +++ b/templates/components/Organisms/MagazineHero.html.twig @@ -0,0 +1,21 @@ +
{{ magazine.summary }}
+ {% endif %} + + {# Use computed property via this.categoryTags #} + {% if this.categoryTags is not empty %} +No categories yet.
+ {% endif %} +{{ magazine.summary }}
- {% endif %} - {# Category links (from 'a' tags) #} - {% set categoryTags = [] %} - {% if magazine.tags is defined %} - {% for tag in magazine.tags %} - {% if tag[0] is defined and tag[0] == 'a' %} - {% set categoryTags = categoryTags|merge([tag]) %} - {% endif %} - {% endfor %} - {% endif %} - {% if categoryTags is not empty %} -No categories yet.
+{{ magazine.summary }}
- {% endif %} - {# Category links (from 'a' tags) #} - {% set categoryTags = [] %} - {% if magazine.tags is defined %} - {% for tag in magazine.tags %} - {% if tag[0] is defined and tag[0] == 'a' %} - {% set categoryTags = categoryTags|merge([tag]) %} - {% endif %} - {% endfor %} - {% endif %} - {% if categoryTags is not empty %} -No categories yet.
- {% endif %} -