Converting html tags description field from md to html. Fixes #110

This commit is contained in:
Dessalines 2020-12-15 18:21:08 -06:00
parent edcaf00486
commit 222c9cee1d

View file

@ -1,6 +1,7 @@
import { Component } from 'inferno';
import { Helmet } from 'inferno-helmet';
import { httpExternalPath } from '../env';
import { md } from '../utils';
interface HtmlTagsProps {
title: string;
@ -18,34 +19,37 @@ export class HtmlTags extends Component<HtmlTagsProps, any> {
<Helmet title={this.props.title}>
{/* Primary Meta Tags */}
<meta name="title" content={this.props.title} />
{this.props.description && (
<meta name="description" content={this.props.description} />
)}
{/* Open Graph / Facebook */}
<meta property="og:type" content="website" />
<meta property="og:url" content={url} />
<meta property="og:title" content={this.props.title} />
{this.props.description && (
<meta property="og:description" content={this.props.description} />
)}
{this.props.image && (
<meta property="og:image" content={this.props.image} />
)}
{/* Twitter */}
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content={url} />
<meta property="twitter:title" content={this.props.title} />
{this.props.description && (
{/* Optional desc and images */}
{this.props.description && [
<meta
name="description"
content={md.renderInline(this.props.description)}
/>,
<meta
property="og:description"
content={md.renderInline(this.props.description)}
/>,
<meta
property="twitter:description"
content={this.props.description}
/>
)}
{this.props.image && (
<meta property="twitter:image" content={this.props.image} />
)}
content={md.renderInline(this.props.description)}
/>,
]}
{this.props.image && [
<meta property="og:image" content={this.props.image} />,
<meta property="twitter:image" content={this.props.image} />,
]}
</Helmet>
);
}