mirror of
https://github.com/sergeyyarkov/devthread.ru.git
synced 2026-10-11 10:19:13 +03:00
added images
This commit is contained in:
parent
1be0388a5c
commit
081e984433
@ -8,7 +8,7 @@ import VkIcon from '../../images/vk-icon.svg'
|
||||
import TwitterIcon from '../../images/twitter-icon__large.svg'
|
||||
import FacebookIcon from '../../images/facebook-icon__large.svg'
|
||||
|
||||
const Article = ({ data: { title, description, category, tags, time, date }, html }) => {
|
||||
const Article = ({ data: { title, image, description, category, tags, time, date }, html }) => {
|
||||
return (
|
||||
<>
|
||||
<SEO title={title} description={description} />
|
||||
@ -61,7 +61,7 @@ const Article = ({ data: { title, description, category, tags, time, date }, htm
|
||||
</div>)}
|
||||
</div>
|
||||
<div className="article-image">
|
||||
<img src="https://c.wallhere.com/photos/fb/a1/JavaScript_minimalism-1227036.jpg!d" alt="article" />
|
||||
<img src={image} alt={title} />
|
||||
</div>
|
||||
<div className="article-inner inner">
|
||||
<div dangerouslySetInnerHTML={{__html: html}}></div>
|
||||
|
||||
@ -2,12 +2,12 @@ import React from 'react';
|
||||
import { Link } from 'gatsby'
|
||||
import './ArticleCard.scss'
|
||||
|
||||
const ArticleCard = ({ data: { slug, title, category, description, tags } }) => {
|
||||
const ArticleCard = ({ data: { slug, title, image, category, description, tags } }) => {
|
||||
return (
|
||||
<article className="article-card">
|
||||
<div className="article-card__image">
|
||||
<Link to={`/article/${slug}`}>
|
||||
<img src="https://c.wallhere.com/photos/fb/a1/JavaScript_minimalism-1227036.jpg!d" alt="article" />
|
||||
<img src={image} alt={title} />
|
||||
</Link>
|
||||
</div>
|
||||
<div className="article-card__heading">
|
||||
|
||||
@ -80,6 +80,7 @@ export const query = graphql`
|
||||
frontmatter {
|
||||
slug
|
||||
title
|
||||
image
|
||||
category
|
||||
tags
|
||||
description
|
||||
|
||||
@ -49,6 +49,7 @@ export const query = graphql`
|
||||
frontmatter {
|
||||
slug
|
||||
title
|
||||
image
|
||||
category
|
||||
tags
|
||||
description
|
||||
|
||||
@ -37,6 +37,7 @@ export const pageQuery = graphql`
|
||||
frontmatter {
|
||||
slug
|
||||
title
|
||||
image
|
||||
time
|
||||
tags
|
||||
description
|
||||
|
||||
@ -14,6 +14,7 @@ collections:
|
||||
- {label: "Slug", name: "slug", widget: "string"}
|
||||
- {label: "Время чтения", name: "time", widget: "string"}
|
||||
- {label: "Заголовок", name: "title", widget: "string"}
|
||||
- {labe: "Обложка", name: "image", widget: "image"}
|
||||
- {label: "Категория", name: "category", widget: "relation", collection: "categories", valueField: "title", searchFields: ["title"]}
|
||||
- {label: "Дата публикации", name: "date", widget: "datetime"}
|
||||
- {label: "Описание", name: "description", widget: "text"}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user