import { useUser } from '../../helpers/UserContext';
import i18n from '../../i18n';
-const Technique = ({ type }) => {
+const Technique = ({ basepath, type }) => {
const params = useParams();
const { name } = params;
const user = useUser();
<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={`/tech/${technique.name}`}
+ base={`/${basepath}/${technique.name}`}
lang={getMatchedLocale(technique, i18n.language)}
langs={getLanguages(technique)}
/>
};
Technique.propTypes = {
+ basepath: PropTypes.string,
type: PropTypes.string,
};