import { Component } from "inferno"; import { Helmet } from "inferno-helmet"; import { httpExternalPath } from "../../env"; import { md } from "../../utils"; interface HtmlTagsProps { title: string; path: string; description?: string; image?: string; } /// Taken from https://metatags.io/ export class HtmlTags extends Component { render() { let url = httpExternalPath(this.props.path); return ( {["title", "og:title", "twitter:title"].map(t => ( ))} {["og:url", "twitter:url"].map(u => ( ))} {/* Open Graph / Facebook */} {/* Twitter */} {/* Optional desc and images */} {this.props.description && ["description", "og:description", "twitter:description"].map(n => ( ))} {this.props.image && ["og:image", "twitter:image"].map(p => ( ))} ); } }