mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-22 20:31:13 +00:00
Converting html tags description field from md to html. Fixes #110
This commit is contained in:
parent
edcaf00486
commit
222c9cee1d
1 changed files with 20 additions and 16 deletions
|
@ -1,6 +1,7 @@
|
||||||
import { Component } from 'inferno';
|
import { Component } from 'inferno';
|
||||||
import { Helmet } from 'inferno-helmet';
|
import { Helmet } from 'inferno-helmet';
|
||||||
import { httpExternalPath } from '../env';
|
import { httpExternalPath } from '../env';
|
||||||
|
import { md } from '../utils';
|
||||||
|
|
||||||
interface HtmlTagsProps {
|
interface HtmlTagsProps {
|
||||||
title: string;
|
title: string;
|
||||||
|
@ -18,34 +19,37 @@ export class HtmlTags extends Component<HtmlTagsProps, any> {
|
||||||
<Helmet title={this.props.title}>
|
<Helmet title={this.props.title}>
|
||||||
{/* Primary Meta Tags */}
|
{/* Primary Meta Tags */}
|
||||||
<meta name="title" content={this.props.title} />
|
<meta name="title" content={this.props.title} />
|
||||||
{this.props.description && (
|
|
||||||
<meta name="description" content={this.props.description} />
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Open Graph / Facebook */}
|
{/* Open Graph / Facebook */}
|
||||||
<meta property="og:type" content="website" />
|
<meta property="og:type" content="website" />
|
||||||
<meta property="og:url" content={url} />
|
<meta property="og:url" content={url} />
|
||||||
<meta property="og:title" content={this.props.title} />
|
<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 */}
|
{/* Twitter */}
|
||||||
<meta property="twitter:card" content="summary_large_image" />
|
<meta property="twitter:card" content="summary_large_image" />
|
||||||
<meta property="twitter:url" content={url} />
|
<meta property="twitter:url" content={url} />
|
||||||
<meta property="twitter:title" content={this.props.title} />
|
<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
|
<meta
|
||||||
property="twitter:description"
|
property="twitter:description"
|
||||||
content={this.props.description}
|
content={md.renderInline(this.props.description)}
|
||||||
/>
|
/>,
|
||||||
)}
|
]}
|
||||||
{this.props.image && (
|
|
||||||
<meta property="twitter:image" content={this.props.image} />
|
{this.props.image && [
|
||||||
)}
|
<meta property="og:image" content={this.props.image} />,
|
||||||
|
<meta property="twitter:image" content={this.props.image} />,
|
||||||
|
]}
|
||||||
</Helmet>
|
</Helmet>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue