/**
* Original file: https://github.com/facebook/docusaurus/blob/main/packages/docusaurus-theme-classic/src/theme/BlogTagsPostsPage/index.tsx
* Copyright (c) Facebook, Inc. and its affiliates under the MIT license.
*
* Modified by David Garcia for Finboot.
*
* Modifications:
* - Add external link and no index support.
*/
import clsx from 'clsx';
import React from 'react';
import type {Props} from '@theme/BlogPostItem/Header/Title';
import Link from '@docusaurus/Link';
import { PageMetadata } from '@docusaurus/theme-common';
// @ts-ignore the api exists on the package but is not exposed
import { useBlogPost } from '@docusaurus/theme-common/internal';
import styles from './styles.module.css';
export default function BlogPostItemHeaderTitle({
className,
}: Props): JSX.Element {
const {metadata, isBlogPostPage} = useBlogPost();
const {permalink, title} = metadata;
const TitleHeading = isBlogPostPage ? 'h1' : 'h2';
let link = ({title});
if (metadata.frontMatter.externalUrl) {
// @ts-ignore externalUrl is a custom property
link = (<>{title}>);
}
let noindex;
if(metadata.frontMatter.externalUrl && isBlogPostPage) {
noindex = ();
}
return (
{isBlogPostPage ? (
title
) : (
link
)}
{noindex}
);
}