<commit_before>import Link from 'next/link';
import { FunctionComponent } from 'react';
import TagsList from './TagsList';
import { format } from 'date-fns';
import BlogPost from "../models/BlogPost";
import ReactMarkdown from 'react-markdown';

interface Props {
  post: BlogPost
}

const BlogPostPreview: FunctionComponent<Props> = ({ post }) => {
  // Without `new Date` is will sometimes crash 🤷‍♂️
  const formattedDate = format(new Date(post.date), 'do MMMM, y')
  return (
    <article key={post.slug}>
      <header>
        <Link href={post.url}>
          <a>
            <h1>{post.title}</h1>
          </a>
        </Link>
        Published { formattedDate }
        {post.tags.length > 0 &&
          <TagsList tags={post.tags}/>
        }
      </header>
      <div>
        <ReactMarkdown source={post.excerpt ?? post.content} />
      </div>
    </article>
  )
}

export default BlogPostPreview;<commit_msg>Add Read More link to blog posts with exerpts<commit_after>import Link from 'next/link';
import { FunctionComponent } from 'react';
import TagsList from './TagsList';
import { format } from 'date-fns';
import BlogPost from "../models/BlogPost";
import ReactMarkdown from 'react-markdown';

interface Props {
  post: BlogPost
}

const BlogPostPreview: FunctionComponent<Props> = ({ post }) => {
  // Without `new Date` is will sometimes crash 🤷‍♂️
  const formattedDate = format(new Date(post.date), 'do MMMM, y')
  return (
    <article key={post.slug}>
      <header>
        <Link href={post.url}>
          <a>
            <h1>{post.title}</h1>
          </a>
        </Link>
        Published { formattedDate }
        {post.tags.length > 0 &&
          <TagsList tags={post.tags}/>
        }
      </header>
      <div>
        <ReactMarkdown source={post.excerpt ?? post.content} />
        {post.excerpt &&
          <Link href={post.url}>
            <a>Read More</a>
          </Link>
        }
      </div>
    </article>
  )
}

export default BlogPostPreview;
{'fraction_non_alphanumeric': 0.14701455092824886, 'fraction_numerical': 0.0030105368790767687, 'mean_word_length': 2.4085470085470084, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3720105', 'n_tokens_mistral': 626, 'n_tokens_neox': 625, 'n_words': 159}