public function web(Request $request, $type, $name) {
$tech = Technique::where('type', '=', $type)->where('name', '=', $name)->first();
if ($tech) {
- return view('app')
+ $view = view('app')
->with('title', $tech->getTranslatedProperty('title'))
->with('description', $tech->getTranslatedProperty('short'));
+ if ($tech->image) {
+ $view = $view->with('image', url($tech->image));
+ } else if ($tech->gif) {
+ $view = $view->with('image', url($tech->gif));
+ }
+ return $view;
}
$url_map = [
'dungeon' => 'dungeons',
<title>{getTranslation(technique, 'title', i18n.language)}</title>
<meta name="description" content={getTranslation(technique, 'short', i18n.language)} />
</Helmet>
+ {technique.image ? <Helmet>
+ <meta property="og:image" content={technique.image} />
+ <meta property="twitter:image" content={technique.image} />
+ </Helmet> : null}
+ {!technique.image && technique.gif ? <Helmet>
+ <meta property="og:image" content={technique.gif} />
+ <meta property="twitter:image" content={technique.gif} />
+ </Helmet> : null}
<CanonicalLinks
base={`/${basepath}/${technique.name}`}
lang={getMatchedLocale(technique, i18n.language)}
@isset($description)
<meta name="description" content="{{ $description }}">
@endisset
+@isset($image)
+ <meta property="og:image" content="{{ $image }}">
+ <meta property="twitter:image" content="{{ $image }}">
+@endisset
<script src="{{ mix('js/manifest.js') }}" defer></script>
<script src="{{ mix('js/vendor.js') }}" defer></script>