<commit_before>import React from 'react'
import { graphql } from 'gatsby'
import Helmet from 'react-helmet'
import AdSense from 'react-adsense'
import DiscussionEmbed from '../components/Disqus'
import Layout from '../components/structure/layout'
import FeedbackSection from '../components/FeedbackSection'
import RelatedArticles from '../components/RelatedArticles'
import Share from '../components/Share'
import ReadProgressLine from '../components/ReadProgressLine'
import TinyLetterSignup from '../components/TinyLetterSignUp'
import ModeSwitch from '../components/Mode'
import EditOnGitHub from '../components/Edit'
import LuckyDraw from '../components/Lucky'
import AskAQuestion from '../components/AskAQuestion'
import ReaderQuestions from '../components/ReaderQuestions'
import PromoBanner from '../components/PromoBanner'
import FeaturedGear from '../components/FeaturedGear'
import YouTubeChannelsPromo from '../components/YouTubeChannelsPromo'
import Tags from '../components/Tags'

class BlogPostTemplate extends React.Component {
  render() {
    const { post, readerQuestions } = this.props.data

    // If post doesn't have a defined og image, fall back to default defined here
    const ogImage =
      post.frontmatter.ogImage !== null
        ? `https://blog.georgi-yanev.com${post.frontmatter.ogImage.publicURL}`
        : `https://blog.georgi-yanev.com/default-ogimage.png`

    const timeToReadEmoji = '⌛'.repeat(Math.ceil(post.timeToRead / 5))

    const disqusShortname = 'blog-georgi-yanev-com'
    const disqusConfig = {
      identifier: post.id,
      title: post.frontmatter.title,
    }

    // Affiliate banners
    let showBanner = false
    const affiliateParam = 'p=NY211410857261201705'
    const bannerLink = `https://www.banggood.com/marketing-Banggood-2019-RC-Toys-Brands-Day/tid-4950.html?bid=21149&${affiliateParam}`
    const bannerLinkBottom = `https://www.banggood.com/marketing-banggood-13th-anniversary-toys-hobbies-robot-sale/tid-3664.html?utmid=9868&utm_design=25&${affiliateParam}`

    if (post.frontmatter.category === 'fpv') {
      showBanner = true
    }

    return (
      <Layout location={this.props.location}>
        <Helmet
          title={`${post.frontmatter.title} - <NAME>`}
          meta={[
            {
              name: 'description',
              content: `${post.frontmatter.ogDescription}`,
            },
            { name: 'keywords', content: `${post.frontmatter.ogKeywords}` },
            { property: 'og:type', content: 'website' },
            {
              property: 'og:url',
              content: `https://blog.georgi-yanev.com${post.frontmatter.path}`,
            },
            {
              property: 'og:image',
              content: ogImage,
            },
            {
              property: 'og:title',
              content: `${post.frontmatter.title} | <NAME>`,
            },
            {
              property: 'og:description',
              content: `${post.frontmatter.ogDescription}`,
            },
            {
              name: 'twitter:card',
              content: 'summary',
            },
            {
              name: 'twitter:site',
              content: '@jumpalottahigh',
            },
            {
              name: 'twitter:image',
              content: ogImage,
            },
            {
              name: 'twitter:creator',
              content: '@jumpalottahigh',
            },
            {
              name: 'twitter:title',
              content: `${post.frontmatter.title} | <NAME>`,
            },
            {
              name: 'twitter:description',
              content: `${post.frontmatter.ogDescription}`,
            },
          ]}
        >
          {/* Google Structured Data */}
          <script type="application/ld+json">{`
          {
            "@context": "http://schema.org",
            "@type": "NewsArticle",
            "mainEntityOfPage": {
              "@type": "WebPage",
              "@id": "https://blog.georgi-yanev.com${post.frontmatter.path}"
            },
            "headline": "${post.frontmatter.title}",
            "name": "${post.frontmatter.title}",
            "author": {
              "@type": "Person",
              "name": "${post.frontmatter.author}"
            },
            "datePublished": "${post.frontmatter.dateUnformatted}",
            "dateModified": "${post.frontmatter.dateUnformatted}",
            "image": [
              "${ogImage}",
              "${ogImage}",
              "${ogImage}"
            ],
            "publisher": {
              "@type": "Organization",
              "name": "<NAME>",
              "logo": {
                "@type": "ImageObject",
                "url": "https://blog.georgi-yanev.com/default-ogimage.png"
              }
            },
            "description": "${post.excerpt}",
            "articleSection": "${post.excerpt}",
            "url": "https://blog.georgi-yanev.com${post.frontmatter.path}"
          }
        `}</script>
        </Helmet>
        <div className="blog-post-container">
          <div className="blog-post">
            <ReadProgressLine />
            <h1>{post.frontmatter.title}</h1>
            <Tags tags={post.frontmatter.tags} />
            <div className="disclaimer-container">
              <div>
                <div className="disclaimer">
                  <a
                    href={
                      post.frontmatter.category === 'fpv'
                        ? 'https://www.youtube.com/channel/UC2gwYMcfb0Oz_fl9W1uTV2Q'
                        : 'https://twitter.com/jumpalottahigh'
                    }
                    target="_blank"
                    rel="noopener noreferrer"<commit_msg>Change link to FPVtips YouTube channel<commit_after>import React from 'react'
import { graphql } from 'gatsby'
import Helmet from 'react-helmet'
import AdSense from 'react-adsense'
import DiscussionEmbed from '../components/Disqus'
import Layout from '../components/structure/layout'
import FeedbackSection from '../components/FeedbackSection'
import RelatedArticles from '../components/RelatedArticles'
import Share from '../components/Share'
import ReadProgressLine from '../components/ReadProgressLine'
import TinyLetterSignup from '../components/TinyLetterSignUp'
import ModeSwitch from '../components/Mode'
import EditOnGitHub from '../components/Edit'
import LuckyDraw from '../components/Lucky'
import AskAQuestion from '../components/AskAQuestion'
import ReaderQuestions from '../components/ReaderQuestions'
import PromoBanner from '../components/PromoBanner'
import FeaturedGear from '../components/FeaturedGear'
import YouTubeChannelsPromo from '../components/YouTubeChannelsPromo'
import Tags from '../components/Tags'

class BlogPostTemplate extends React.Component {
  render() {
    const { post, readerQuestions } = this.props.data

    // If post doesn't have a defined og image, fall back to default defined here
    const ogImage =
      post.frontmatter.ogImage !== null
        ? `https://blog.georgi-yanev.com${post.frontmatter.ogImage.publicURL}`
        : `https://blog.georgi-yanev.com/default-ogimage.png`

    const timeToReadEmoji = '⌛'.repeat(Math.ceil(post.timeToRead / 5))

    const disqusShortname = 'blog-georgi-yanev-com'
    const disqusConfig = {
      identifier: post.id,
      title: post.frontmatter.title,
    }

    // Affiliate banners
    let showBanner = false
    const affiliateParam = 'p=NY211410857261201705'
    const bannerLink = `https://www.banggood.com/marketing-Banggood-2019-RC-Toys-Brands-Day/tid-4950.html?bid=21149&${affiliateParam}`
    const bannerLinkBottom = `https://www.banggood.com/marketing-banggood-13th-anniversary-toys-hobbies-robot-sale/tid-3664.html?utmid=9868&utm_design=25&${affiliateParam}`

    if (post.frontmatter.category === 'fpv') {
      showBanner = true
    }

    return (
      <Layout location={this.props.location}>
        <Helmet
          title={`${post.frontmatter.title} - Georgi Yanev`}
          meta={[
            {
              name: 'description',
              content: `${post.frontmatter.ogDescription}`,
            },
            { name: 'keywords', content: `${post.frontmatter.ogKeywords}` },
            { property: 'og:type', content: 'website' },
            {
              property: 'og:url',
              content: `https://blog.georgi-yanev.com${post.frontmatter.path}`,
            },
            {
              property: 'og:image',
              content: ogImage,
            },
            {
              property: 'og:title',
              content: `${post.frontmatter.title} | <NAME>`,
            },
            {
              property: 'og:description',
              content: `${post.frontmatter.ogDescription}`,
            },
            {
              name: 'twitter:card',
              content: 'summary',
            },
            {
              name: 'twitter:site',
              content: '@jumpalottahigh',
            },
            {
              name: 'twitter:image',
              content: ogImage,
            },
            {
              name: 'twitter:creator',
              content: '@jumpalottahigh',
            },
            {
              name: 'twitter:title',
              content: `${post.frontmatter.title} | <NAME>`,
            },
            {
              name: 'twitter:description',
              content: `${post.frontmatter.ogDescription}`,
            },
          ]}
        >
          {/* Google Structured Data */}
          <script type="application/ld+json">{`
          {
            "@context": "http://schema.org",
            "@type": "NewsArticle",
            "mainEntityOfPage": {
              "@type": "WebPage",
              "@id": "https://blog.georgi-yanev.com${post.frontmatter.path}"
            },
            "headline": "${post.frontmatter.title}",
            "name": "${post.frontmatter.title}",
            "author": {
              "@type": "Person",
              "name": "${post.frontmatter.author}"
            },
            "datePublished": "${post.frontmatter.dateUnformatted}",
            "dateModified": "${post.frontmatter.dateUnformatted}",
            "image": [
              "${ogImage}",
              "${ogImage}",
              "${ogImage}"
            ],
            "publisher": {
              "@type": "Organization",
              "name": "<NAME>",
              "logo": {
                "@type": "ImageObject",
                "url": "https://blog.georgi-yanev.com/default-ogimage.png"
              }
            },
            "description": "${post.excerpt}",
            "articleSection": "${post.excerpt}",
            "url": "https://blog.georgi-yanev.com${post.frontmatter.path}"
          }
        `}</script>
        </Helmet>
        <div className="blog-post-container">
          <div className="blog-post">
            <ReadProgressLine />
            <h1>{post.frontmatter.title}</h1>
            <Tags tags={post.frontmatter.tags} />
            <div className="disclaimer-container">
              <div>
                <div className="disclaimer">
                  <a
                    href={
                      post.frontmatter.category === 'fpv'
                        ? 'https://www.youtube.com/channel/UCCh3SK2EktDdOQkEOTDmSCg'
                        : 'https://twitter.com/jumpalottahigh'
                    }
                    target="_blank"
                    rel="noopener noreferrer"
{'fraction_non_alphanumeric': 0.14114978626886504, 'fraction_numerical': 0.008636482596179012, 'mean_word_length': 1.8049914362613164, 'pattern_counts': {'":': 44, '<': 40, '<?xml version=': 0, '>': 38, 'https://': 20, 'lorem ipsum': 0, 'www.': 6, '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': '1974902', 'n_tokens_mistral': 3305, 'n_tokens_neox': 3148, 'n_words': 551}