]> git.localhorst.tv Git - alttp.git/commitdiff
tournament images
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Wed, 30 Jul 2025 12:52:17 +0000 (14:52 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Wed, 30 Jul 2025 12:52:17 +0000 (14:52 +0200)
app/Http/Controllers/TournamentController.php
resources/js/pages/Front.jsx
resources/js/pages/Tournament.jsx

index a8fa952d24851388207dce81690e2fb97de0b401..58b6222f3dca6aaee2af44cab54d3ec2dcdf7c67 100644 (file)
@@ -160,6 +160,13 @@ class TournamentController extends Controller
                $view = view('app')
                        ->with('title', $tournament->getTranslatedTitle())
                        ->with('description', $tournament->getTranslatedShort());
+               if ($tournament->description) {
+                       if ($tournament->description->image) {
+                               $view = $view->with('image', url($tournament->description->image));
+                       } elseif ($tournament->description->gif) {
+                               $view = $view->with('image', url($tournament->description->gif));
+                       }
+               }
                return $view;
        }
 
index 80dd6713bfbdeb462cc1f7b73743929ca538da52..1609c1a83c69f3d77616cc69acb49a35ccb3f2b8 100644 (file)
@@ -32,7 +32,7 @@ const Front = () => {
                        </Col>
                        <Col sm={6}>
                                <Link className="front-panel" to="/tournaments/mystery-zirkus">
-                                       <Image alt="" className="image" src="/media/alttp/front.png" />
+                                       <Image alt="" className="image" src="/media/alttp/circus.png" />
                                        <div className="title">
                                                {t('front.circus')}
                                        </div>
index 871c70684ebbfd255142a4b8e4be6de2f4447429..93bfb857d7d353d1fe709b6e424a84781c04bb8d 100644 (file)
@@ -208,6 +208,10 @@ export const Component = () => {
                                content={getTranslation(tournament.description, 'short', i18n.language)}
                        />
                </Helmet> : null}
+               {tournament.description?.image ? <Helmet>
+                       <meta property="og:image" content={tournament.description.image} />
+                       <meta property="twitter:image" content={tournament.description.image} />
+               </Helmet> : null}
                <CanonicalLinks base={`/tournaments/${tournament.name || tournament.id}`} />
                <Detail
                        actions={actions}