diff --git a/config.js b/config.js new file mode 100644 index 0000000..8878f75 --- /dev/null +++ b/config.js @@ -0,0 +1,38 @@ +module.exports = { + title: 'devthread.ru', + keywords: 'веб разработка, javascript, seo, программирование, reactjs, graphql', + siteName: 'Cборник статей и руководств - devthread.ru', + titleTemplate: '%s · статьи и руководства по веб-разработке', + description: 'Cборник статей и руководств по тематике веб-разработки и IT для того чтобы помочь вам', + url: 'https://devthread.netlify.app', + menuLinks: [ + { + name: 'Статьи', + link: '/articles' + }, + { + name: 'О сайте', + link: '/about' + }, + { + name: 'Контакты', + link: '/contacts' + }, + { + name: 'Сниппеты', + link: '/snippets' + } + ], + social: { + email: 'support@devthread.ru', + telegram: 'https://t.me/devthread', + twitter: 'https://twitter.com/devthread', + yadzen: 'https://zen.yandex.ru/' + }, + options: { + articles: { + onPage: 6, + onLoadMore: 2 + } + } +} \ No newline at end of file diff --git a/gatsby-config.js b/gatsby-config.js index 4273e2c..dc7cad5 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -1,43 +1,10 @@ require('dotenv').config() +const siteConfig = require('./config') + module.exports = { siteMetadata: { - title: 'devthread.ru', - keywords: 'веб разработка, javascript, seo, программирование, reactjs, graphql', - siteName: 'Cборник статей и руководств - devthread.ru', - titleTemplate: '%s · статьи и руководства по веб-разработке', - description: 'Cборник статей и руководств по тематике веб-разработки и IT для того чтобы помочь вам', - url: 'https://devthread.netlify.app', - menuLinks: [ - { - name: 'Статьи', - link: '/articles' - }, - { - name: 'О сайте', - link: '/about' - }, - { - name: 'Контакты', - link: '/contacts' - }, - { - name: 'Сниппеты', - link: '/snippets' - } - ], - social: { - email: 'support@devthread.ru', - telegram: 'https://t.me/devthread', - twitter: 'https://twitter.com/devthread', - yadzen: 'https://zen.yandex.ru/' - }, - options: { - articles: { - onPage: 6, - onLoadMore: 2 - } - } + ...siteConfig }, plugins: [ 'gatsby-plugin-react-helmet', @@ -142,6 +109,12 @@ module.exports = { ], }, }, + { + resolve: `gatsby-plugin-disqus`, + options: { + shortname: `devthread` + } + }, { resolve: 'gatsby-plugin-react-svg', options: { diff --git a/package-lock.json b/package-lock.json index bd2cf42..5c259d2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9071,6 +9071,11 @@ "micromatch": "^3.1.10" } }, + "gatsby-plugin-disqus": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gatsby-plugin-disqus/-/gatsby-plugin-disqus-1.2.0.tgz", + "integrity": "sha512-1Vgifach9KOCTKWmOESHbGDEAVxLwg7uJZbSyohQzBqqDzfnl42SOWJhIPCOCAtKi1GcqU4JIQiWBZmN1V0Zlg==" + }, "gatsby-plugin-firebase": { "version": "0.2.0-beta.4", "resolved": "https://registry.npmjs.org/gatsby-plugin-firebase/-/gatsby-plugin-firebase-0.2.0-beta.4.tgz", diff --git a/package.json b/package.json index 5cc1bae..2a3271d 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "firebase": "^7.16.0", "gatsby": "^2.23.12", "gatsby-image": "^2.4.12", + "gatsby-plugin-disqus": "^1.2.0", "gatsby-plugin-firebase": "^0.2.0-beta.4", "gatsby-plugin-manifest": "^2.4.17", "gatsby-plugin-netlify-cms": "^4.3.9", diff --git a/src/components/Article/Article.js b/src/components/Article/Article.js index a174024..ea679df 100644 --- a/src/components/Article/Article.js +++ b/src/components/Article/Article.js @@ -1,5 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types' +import { Disqus, CommentCount } from 'gatsby-plugin-disqus' import SEO from '../SEO/SEO' import Img from "gatsby-image" import ViewCounter from '../ViewCounter/ViewCounter' @@ -17,6 +18,14 @@ const Article = ({ data: { slug, keywords, title, image, description, category, const { siteMetadata: { siteUrl } } = useSiteMetadataQuery() const { pathname } = useLocation() + console.log(siteUrl+pathname) + + let disqusConfig = { + url: `${siteUrl+pathname}`, + identifier: slug, + title: title, + } + return ( <> @@ -81,6 +90,7 @@ const Article = ({ data: { slug, keywords, title, image, description, category,

Комментарии

+
diff --git a/src/components/Offers/Subscription/Subscription.js b/src/components/Offers/Subscription/Subscription.js index 6950af1..a08f3b0 100644 --- a/src/components/Offers/Subscription/Subscription.js +++ b/src/components/Offers/Subscription/Subscription.js @@ -7,11 +7,11 @@ const Subscription = () => {
- Читайте нас в Telegram + Канал в Telegram

- В нашем канале telegram вы не пропустите новые статьи, присоединяйтесь к другим разработчикам + В нашем канале telegram вы не пропустите статьи и новости, присоединяйтесь к другим разработчикам

Подписаться
diff --git a/static/admin/config.yml b/static/admin/config.yml index b2fe698..7cc694a 100644 --- a/static/admin/config.yml +++ b/static/admin/config.yml @@ -1,14 +1,15 @@ backend: name: github repo: sergeyyarkov/devthread.ru -media_folder: static/assets -public_folder: /assets +locale: 'ru' +media_folder: "static/images/uploads" +public_folder: "/images/uploads" collections: - name: "articles" label: "Article" folder: "content/articles" create: true - slug: "{{slug}}" + slug: "{{year}}-{{month}}-{{day}}_{{slug}}" fields: - {label: "Template Key", name: "templateKey", wisdget: "hidden", default: "article"} - {label: "Slug", name: "slug", widget: "string"} @@ -26,7 +27,7 @@ collections: label: "Snippet" folder: 'content/snippets' create: true - slug: "{{slug}}" + slug: "{{year}}-{{month}}-{{day}}_{{slug}}" fields: - {label: "Template key", name: "templateKey", widget: "hidden", default: "snippet"} - {label: "Slug", name: "slug", widget: "string"}