1 import { Component } from "inferno";
2 import { Helmet } from "inferno-helmet";
3 import { httpExternalPath } from "../../env";
4 import { md } from "../../utils";
6 interface HtmlTagsProps {
13 /// Taken from https://metatags.io/
14 export class HtmlTags extends Component<HtmlTagsProps, any> {
16 let url = httpExternalPath(this.props.path);
19 <Helmet title={this.props.title}>
20 {["title", "og:title", "twitter:title"].map(t => (
21 <meta property={t} content={this.props.title} />
23 {["og:url", "twitter:url"].map(u => (
24 <meta property={u} content={url} />
27 {/* Open Graph / Facebook */}
28 <meta property="og:type" content="website" />
31 <meta property="twitter:card" content="summary_large_image" />
33 {/* Optional desc and images */}
34 {this.props.description &&
35 ["description", "og:description", "twitter:description"].map(n => (
36 <meta name={n} content={md.renderInline(this.props.description)} />
40 ["og:image", "twitter:image"].map(p => (
41 <meta property={p} content={this.props.image} />