This commit is contained in:
Karol Wypchlo 2021-04-01 01:01:32 +02:00
parent f9aa65e67a
commit bcdf2e8f56
2 changed files with 14 additions and 7 deletions

View File

@ -1,15 +1,14 @@
import * as React from "react";
import { graphql } from "gatsby";
import Layout, { Section, SectionTitle } from "../components/Layout";
import Layout, { Section } from "../components/Layout";
import { Aside } from "../components/News";
import Link from "../components/Link";
import SEO from "../components/seo";
const NewsCard = ({ ...props }) => {
console.log(props);
return (
<div className="flex flex-col">
<img src="https://placekitten.com/320/170" />
<img src={`https://picsum.photos/320/170?${Math.random()}`} alt={props.frontmatter.title} />
<Link to={props.fields.slug} className="text-xl mt-6 hover:text-primary transition-colors duration-200">
{props.frontmatter.title}
</Link>

View File

@ -4,14 +4,14 @@ import Layout, { Section, SectionTitle } from "../components/Layout";
import { Aside } from "../components/News";
import SEO from "../components/seo";
import { TwitterShareButton, LinkedinShareButton, FacebookShareButton } from "react-share";
import { TwitterSmall, LinkedinSmall, FacebookSmall } from "../components/Icons";
import { TwitterSmall, LinkedinSmall } from "../components/Icons";
const BlogPostTemplate = ({ data, location }) => {
const post = data.markdownRemark;
const siteTitle = data.site.siteMetadata?.title || `Title`;
// const { previous, next } = data;
console.log(post);
// console.log(post);
return (
<Layout location={location} title={siteTitle}>
@ -31,13 +31,21 @@ const BlogPostTemplate = ({ data, location }) => {
<div className="flex items-center">
<div class="text-xs uppercase mr-4">Share</div>
<TwitterShareButton url={location.href} title={post.frontmatter.title}>
<TwitterShareButton url={location.href} title={post.frontmatter.title} hashtags={[]}>
<TwitterSmall />
</TwitterShareButton>
<LinkedinShareButton url={location.href} title={post.frontmatter.title}>
<LinkedinShareButton
url={location.href}
title={post.frontmatter.title}
summary={post.frontmatter.description}
>
<LinkedinSmall />
</LinkedinShareButton>
<FacebookShareButton url={location.href} quote={post.frontmatter.title}>
<LinkedinSmall />
</FacebookShareButton>
</div>
</aside>
<section dangerouslySetInnerHTML={{ __html: post.html }} itemProp="articleBody" className="col-span-2" />