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