mirror of
https://github.com/sergeyyarkov/devthread.ru.git
synced 2026-10-11 10:19:13 +03:00
cms
This commit is contained in:
parent
27561a69d0
commit
0aad226325
@ -31,10 +31,11 @@ module.exports = {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
'gatsby-plugin-netlify-cms',
|
||||||
'gatsby-plugin-react-helmet',
|
'gatsby-plugin-react-helmet',
|
||||||
'gatsby-plugin-sass',
|
'gatsby-plugin-sass',
|
||||||
{
|
{
|
||||||
resolve: "gatsby-plugin-react-svg",
|
resolve: 'gatsby-plugin-react-svg',
|
||||||
options: {
|
options: {
|
||||||
rule: {
|
rule: {
|
||||||
include: /images/
|
include: /images/
|
||||||
|
|||||||
2349
package-lock.json
generated
2349
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -17,10 +17,12 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@reach/router": "^1.3.4",
|
"@reach/router": "^1.3.4",
|
||||||
"gatsby": "^2.23.12",
|
"gatsby": "^2.23.12",
|
||||||
|
"gatsby-plugin-netlify-cms": "^4.3.9",
|
||||||
"gatsby-plugin-react-helmet": "^3.3.8",
|
"gatsby-plugin-react-helmet": "^3.3.8",
|
||||||
"gatsby-plugin-react-svg": "^3.0.0",
|
"gatsby-plugin-react-svg": "^3.0.0",
|
||||||
"gatsby-plugin-sass": "^2.3.7",
|
"gatsby-plugin-sass": "^2.3.7",
|
||||||
"gatsby-source-filesystem": "^2.3.14",
|
"gatsby-source-filesystem": "^2.3.14",
|
||||||
|
"netlify-cms-app": "^2.12.16",
|
||||||
"node-sass": "^4.14.1",
|
"node-sass": "^4.14.1",
|
||||||
"prop-types": "^15.7.2",
|
"prop-types": "^15.7.2",
|
||||||
"react": "^16.12.0",
|
"react": "^16.12.0",
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import ContactsFrom from './ContactsForm/ContactsForm';
|
||||||
import useSiteMetadata from '../../hooks/useSiteMetadata'
|
import useSiteMetadata from '../../hooks/useSiteMetadata'
|
||||||
import './Contacts.scss'
|
import './Contacts.scss'
|
||||||
|
|
||||||
@ -18,18 +19,7 @@ const Contacts = () => {
|
|||||||
Для того чтобы задать вопрос, сообщить об ошибках или просто поздороваться, вы можете воспользоваться формой обратной связи или использовать контактные данные.
|
Для того чтобы задать вопрос, сообщить об ошибках или просто поздороваться, вы можете воспользоваться формой обратной связи или использовать контактные данные.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="contacts-form">
|
<ContactsFrom />
|
||||||
<h2>форма обратной связи</h2>
|
|
||||||
<form action="#">
|
|
||||||
<input placeholder="Ваше имя" type="text" />
|
|
||||||
<input placeholder="Ваша почта" type="text" />
|
|
||||||
<input placeholder="Тема сообщения" type="text" />
|
|
||||||
<textarea placeholder="Ваше сообщение..." defaultValue={""} />
|
|
||||||
<div className="submit-btn">
|
|
||||||
<button className="btn-primary">Отправить</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<div className="contacts-info">
|
<div className="contacts-info">
|
||||||
<h2>контактные данные</h2>
|
<h2>контактные данные</h2>
|
||||||
<ul>
|
<ul>
|
||||||
|
|||||||
20
src/components/Contacts/ContactsForm/ContactsForm.js
Normal file
20
src/components/Contacts/ContactsForm/ContactsForm.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
const ContactsFrom = () => {
|
||||||
|
return (
|
||||||
|
<div className="contacts-form">
|
||||||
|
<h2>форма обратной связи</h2>
|
||||||
|
<form action="#">
|
||||||
|
<input placeholder="Ваше имя" type="text" />
|
||||||
|
<input placeholder="Ваша почта" type="text" />
|
||||||
|
<input placeholder="Тема сообщения" type="text" />
|
||||||
|
<textarea placeholder="Ваше сообщение..." defaultValue={""} />
|
||||||
|
<div className="submit-btn">
|
||||||
|
<button className="btn-primary">Отправить</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ContactsFrom
|
||||||
@ -2,14 +2,16 @@ import React from 'react';
|
|||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import './Footer.scss'
|
import './Footer.scss'
|
||||||
|
|
||||||
|
import LogoIcon from '../../images/logo-icon.svg'
|
||||||
|
import GatsbyIcon from '../../images/gatsby-icon.svg'
|
||||||
|
import NetlifyIcon from '../../images/netlify-icon.svg'
|
||||||
|
|
||||||
const Footer = ({ title }) => {
|
const Footer = ({ title }) => {
|
||||||
return (
|
return (
|
||||||
<footer>
|
<footer>
|
||||||
<div className="footer-content">
|
<div className="footer-content">
|
||||||
<div className="footer-content__logo">
|
<div className="footer-content__logo">
|
||||||
<svg width={27} height={20} viewBox="0 0 27 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<LogoIcon />
|
||||||
<path className="logo-img" d="M12.854 18.361C13.484 19.262 14.491 19.245 15.09 18.323L25.91 1.67701C26.509 0.755007 26.1 7.62939e-06 25 7.62939e-06L1.99999 7.62939e-06C0.89999 7.62939e-06 0.516991 0.737007 1.14599 1.63901L12.854 18.361Z" fill="#2D2D2D" />
|
|
||||||
</svg>
|
|
||||||
<a href="/">{title}</a>
|
<a href="/">{title}</a>
|
||||||
</div>
|
</div>
|
||||||
<div className="footer-content__nav">
|
<div className="footer-content__nav">
|
||||||
@ -40,16 +42,11 @@ const Footer = ({ title }) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="footer-nav__helpers">
|
<div className="footer-nav__helpers">
|
||||||
<a href="/" target="_blank">
|
<a href="https://www.gatsbyjs.org/" rel='noreferrer' target="_blank">
|
||||||
<svg width={30} height={30} viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<GatsbyIcon />
|
||||||
<path d="M15 30C23.2843 30 30 23.2843 30 15C30 6.71573 23.2843 0 15 0C6.71573 0 0 6.71573 0 15C0 23.2843 6.71573 30 15 30Z" fill="#663399" />
|
|
||||||
<path d="M6.64287 23.3571C4.39287 21.1071 3.21429 18.1071 3.21429 15.2142L14.8929 26.7857C11.8929 26.6785 8.89287 25.6071 6.64287 23.3571Z" fill="white" />
|
|
||||||
<path d="M17.5714 26.4642L3.53571 12.4285C4.71428 7.17852 9.42856 3.21423 15 3.21423C18.9643 3.21423 22.3928 5.1428 24.5357 8.03566L22.9286 9.42852C21.1071 6.96423 18.2143 5.35709 15 5.35709C10.8214 5.35709 7.28571 8.03566 5.89285 11.7857L18.2143 24.1071C21.3214 23.0357 23.6786 20.3571 24.4286 17.1428H19.2857V14.9999H26.7857C26.7857 20.5714 22.8214 25.2857 17.5714 26.4642Z" fill="white" />
|
|
||||||
</svg>
|
|
||||||
</a>
|
</a>
|
||||||
<a href="/" target="_blank">
|
<a href="https://www.netlify.com/" rel='noreferrer' target="_blank">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width={30} height={30} viewBox="0 0 256 256" preserveAspectRatio="xMidYMid">
|
<NetlifyIcon />
|
||||||
<path d="M153.094 165.679l-62.785-13.12a14.631 14.631 0 0 1-.876 1.475l57.157 83.378 3.448-3.444 9.724-60.47a11.458 11.458 0 0 1-6.668-7.82zM130.19 83.605c-2.352 3.608-6.412 5.996-11.036 5.996-.712 0-1.404-.072-2.084-.18l-28.633 44.801 76.498-32.92c-.024-.308-.092-.596-.092-.912 0-.644.088-1.268.192-1.884l-34.845-14.9zm2.08-8.164l37.065 15.848a11.447 11.447 0 0 1 3.976-2.008l6.092-37.88-23.209-23.209L130.07 69.07a13.013 13.013 0 0 1 2.2 6.372zm77.665 6.492l-23.26-23.264-5.056 31.408a11.628 11.628 0 0 1 3.396 2.584l24.92-10.728zm-55.729 75.473a11.355 11.355 0 0 1 9.089-5.844l6.68-41.548c-.524-.348-.992-.764-1.452-1.192l-76.938 33.112c.196.804.332 1.624.396 2.476l62.225 12.996zm62.065-69.133l-26.912 11.58 66.401 28.389.24-.24-39.729-39.729zm-48.092 85.35l-8.088 50.284 46.964-46.964-33.828-7.064a11.366 11.366 0 0 1-5.048 3.744zm-91.286-12.928c-1.7 0-3.328-.292-4.852-.809l-15.6 24.413-6.028-6.024 14.776-23.12a16.066 16.066 0 0 1-1.02-1.417l-26.768 11.525-6.345-6.345 29.3-12.612L7.385 135.25.14 128.002l2.292-2.292 61.085 12.752a14.981 14.981 0 0 1 2.668-3.616L36.537 91.601l5.988-5.988L73.5 130.798a15.283 15.283 0 0 1 3.392-.396c1.308 0 2.576.184 3.788.496l28.985-45.353a13.126 13.126 0 0 1-3.676-9.116c0-1.04.132-2.048.36-3.016l-36.16-15.46 6.343-6.344 34.26 14.652a13.12 13.12 0 0 1 12.653-2.268l26.724-41.825L128.002 0 0 128.002l128.002 128.002 12.596-12.596-57.585-84.01a15.117 15.117 0 0 1-6.12 1.297zm101.23-48.89l-6.796 42.237a11.359 11.359 0 0 1 4.196 7.813l38.572 8.052 35.32-35.32-63.752-27.257a11.508 11.508 0 0 1-7.54 4.476z" fill="#25C7B7" /></svg>
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import { Link } from 'gatsby'
|
|||||||
import ThemeContext from '../../context/ThemeContext'
|
import ThemeContext from '../../context/ThemeContext'
|
||||||
import './Header.scss'
|
import './Header.scss'
|
||||||
|
|
||||||
|
import LogoIcon from '../../images/logo-icon.svg'
|
||||||
import TelegramIcon from '../../images/telegram-icon.svg'
|
import TelegramIcon from '../../images/telegram-icon.svg'
|
||||||
import TwitterIcon from '../../images/twitter-icon.svg'
|
import TwitterIcon from '../../images/twitter-icon.svg'
|
||||||
import MoonIcon from '../../images/moon-icon.svg'
|
import MoonIcon from '../../images/moon-icon.svg'
|
||||||
@ -34,9 +35,7 @@ const Header = ({ title, menuLinks }) => {
|
|||||||
<header className={isScrolled ? 'headerScrolled' : null}>
|
<header className={isScrolled ? 'headerScrolled' : null}>
|
||||||
<div className="header-content">
|
<div className="header-content">
|
||||||
<div className="header-content__logo">
|
<div className="header-content__logo">
|
||||||
<svg width={27} height={20} viewBox="0 0 27 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<LogoIcon />
|
||||||
<path className="logo-img" d="M12.854 18.361C13.484 19.262 14.491 19.245 15.09 18.323L25.91 1.67701C26.509 0.755007 26.1 7.62939e-06 25 7.62939e-06L1.99999 7.62939e-06C0.89999 7.62939e-06 0.516991 0.737007 1.14599 1.63901L12.854 18.361Z" fill="#2D2D2D" />
|
|
||||||
</svg>
|
|
||||||
<Link to='/'>{title}</Link>
|
<Link to='/'>{title}</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className="header-content__nav desktop">
|
<div className="header-content__nav desktop">
|
||||||
|
|||||||
1
src/images/gatsby-icon.svg
Normal file
1
src/images/gatsby-icon.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15 30C23.2843 30 30 23.2843 30 15C30 6.71573 23.2843 0 15 0C6.71573 0 0 6.71573 0 15C0 23.2843 6.71573 30 15 30Z" fill="#663399"></path><path d="M6.64287 23.3571C4.39287 21.1071 3.21429 18.1071 3.21429 15.2142L14.8929 26.7857C11.8929 26.6785 8.89287 25.6071 6.64287 23.3571Z" fill="white"></path><path d="M17.5714 26.4642L3.53571 12.4285C4.71428 7.17852 9.42856 3.21423 15 3.21423C18.9643 3.21423 22.3928 5.1428 24.5357 8.03566L22.9286 9.42852C21.1071 6.96423 18.2143 5.35709 15 5.35709C10.8214 5.35709 7.28571 8.03566 5.89285 11.7857L18.2143 24.1071C21.3214 23.0357 23.6786 20.3571 24.4286 17.1428H19.2857V14.9999H26.7857C26.7857 20.5714 22.8214 25.2857 17.5714 26.4642Z" fill="white"></path></svg>
|
||||||
|
After Width: | Height: | Size: 804 B |
1
src/images/logo-icon.svg
Normal file
1
src/images/logo-icon.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg width="27" height="20" viewBox="0 0 27 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path class="logo-img" d="M12.854 18.361C13.484 19.262 14.491 19.245 15.09 18.323L25.91 1.67701C26.509 0.755007 26.1 7.62939e-06 25 7.62939e-06L1.99999 7.62939e-06C0.89999 7.62939e-06 0.516991 0.737007 1.14599 1.63901L12.854 18.361Z" fill="#2D2D2D"></path></svg>
|
||||||
|
After Width: | Height: | Size: 357 B |
1
src/images/netlify-icon.svg
Normal file
1
src/images/netlify-icon.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 256 256" preserveAspectRatio="xMidYMid"><path d="M153.094 165.679l-62.785-13.12a14.631 14.631 0 0 1-.876 1.475l57.157 83.378 3.448-3.444 9.724-60.47a11.458 11.458 0 0 1-6.668-7.82zM130.19 83.605c-2.352 3.608-6.412 5.996-11.036 5.996-.712 0-1.404-.072-2.084-.18l-28.633 44.801 76.498-32.92c-.024-.308-.092-.596-.092-.912 0-.644.088-1.268.192-1.884l-34.845-14.9zm2.08-8.164l37.065 15.848a11.447 11.447 0 0 1 3.976-2.008l6.092-37.88-23.209-23.209L130.07 69.07a13.013 13.013 0 0 1 2.2 6.372zm77.665 6.492l-23.26-23.264-5.056 31.408a11.628 11.628 0 0 1 3.396 2.584l24.92-10.728zm-55.729 75.473a11.355 11.355 0 0 1 9.089-5.844l6.68-41.548c-.524-.348-.992-.764-1.452-1.192l-76.938 33.112c.196.804.332 1.624.396 2.476l62.225 12.996zm62.065-69.133l-26.912 11.58 66.401 28.389.24-.24-39.729-39.729zm-48.092 85.35l-8.088 50.284 46.964-46.964-33.828-7.064a11.366 11.366 0 0 1-5.048 3.744zm-91.286-12.928c-1.7 0-3.328-.292-4.852-.809l-15.6 24.413-6.028-6.024 14.776-23.12a16.066 16.066 0 0 1-1.02-1.417l-26.768 11.525-6.345-6.345 29.3-12.612L7.385 135.25.14 128.002l2.292-2.292 61.085 12.752a14.981 14.981 0 0 1 2.668-3.616L36.537 91.601l5.988-5.988L73.5 130.798a15.283 15.283 0 0 1 3.392-.396c1.308 0 2.576.184 3.788.496l28.985-45.353a13.126 13.126 0 0 1-3.676-9.116c0-1.04.132-2.048.36-3.016l-36.16-15.46 6.343-6.344 34.26 14.652a13.12 13.12 0 0 1 12.653-2.268l26.724-41.825L128.002 0 0 128.002l128.002 128.002 12.596-12.596-57.585-84.01a15.117 15.117 0 0 1-6.12 1.297zm101.23-48.89l-6.796 42.237a11.359 11.359 0 0 1 4.196 7.813l38.572 8.052 35.32-35.32-63.752-27.257a11.508 11.508 0 0 1-7.54 4.476z" fill="#25C7B7"></path></svg>
|
||||||
|
After Width: | Height: | Size: 1.7 KiB |
26
static/admin/config.yml
Normal file
26
static/admin/config.yml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
backend:
|
||||||
|
name: sergeyyarkov/devthread.ru
|
||||||
|
media_folder: static/assets
|
||||||
|
public_folder: /assets
|
||||||
|
collections:
|
||||||
|
- name: "articles"
|
||||||
|
label: "Article"
|
||||||
|
folder: "src/pages/blog"
|
||||||
|
create: true
|
||||||
|
slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
|
||||||
|
fields:
|
||||||
|
- {label: "Template Key", name: "templateKey", widget: "hidden", default: "article"}
|
||||||
|
- {label: "Заголовок", name: "title", widget: "string"}
|
||||||
|
- {label: "Категория", name: "category", widget: "relation", collection: "categories", valueField: "name.first", searchFields: ["name.first"]}
|
||||||
|
- {label: "Дата публикации", name: "date", widget: "datetime"}
|
||||||
|
- {label: "Описание", name: "description", widget: "text"}
|
||||||
|
- {label: "Содержание", name: "body", widget: "markdown"}
|
||||||
|
- {label: "Тэги", name: "tags", widget: "list"}
|
||||||
|
- name: 'categories'
|
||||||
|
label: "Category"
|
||||||
|
folder: 'src/pages/blog/categories'
|
||||||
|
create: true
|
||||||
|
slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
|
||||||
|
fields:
|
||||||
|
- {label: "Template key", name: "templateKey", widget: "hidden", default: "category"}
|
||||||
|
- {label: "Название категории", name: "title", widget: "string"}
|
||||||
Loading…
x
Reference in New Issue
Block a user