mirror of
https://github.com/sergeyyarkov/devthread.ru.git
synced 2026-10-11 10:19:13 +03:00
pathame fix
This commit is contained in:
parent
63a7c9e62b
commit
edd0131f46
@ -46,7 +46,7 @@ exports.createPages = async ({ actions, graphql }) => {
|
|||||||
|
|
||||||
articles.forEach(({ node }) => {
|
articles.forEach(({ node }) => {
|
||||||
createPage({
|
createPage({
|
||||||
path: `article/${node.frontmatter.slug}`,
|
path: `article/${node.frontmatter.slug}/`,
|
||||||
component: articleTemplate,
|
component: articleTemplate,
|
||||||
context: {
|
context: {
|
||||||
slug: node.frontmatter.slug,
|
slug: node.frontmatter.slug,
|
||||||
@ -56,7 +56,7 @@ exports.createPages = async ({ actions, graphql }) => {
|
|||||||
|
|
||||||
snippets.forEach(({ node }) => {
|
snippets.forEach(({ node }) => {
|
||||||
createPage({
|
createPage({
|
||||||
path: `snippet/${node.frontmatter.slug}`,
|
path: `snippet/${node.frontmatter.slug}/`,
|
||||||
component: snippetTemplate,
|
component: snippetTemplate,
|
||||||
context: {
|
context: {
|
||||||
slug: node.frontmatter.slug,
|
slug: node.frontmatter.slug,
|
||||||
@ -66,7 +66,7 @@ exports.createPages = async ({ actions, graphql }) => {
|
|||||||
|
|
||||||
categories.forEach(({ node }) => {
|
categories.forEach(({ node }) => {
|
||||||
createPage({
|
createPage({
|
||||||
path: `category/${slugify(node.frontmatter.title)}`,
|
path: `category/${slugify(node.frontmatter.title)}/`,
|
||||||
component: categoryTemplate,
|
component: categoryTemplate,
|
||||||
context: {
|
context: {
|
||||||
title: node.frontmatter.title,
|
title: node.frontmatter.title,
|
||||||
@ -76,7 +76,7 @@ exports.createPages = async ({ actions, graphql }) => {
|
|||||||
|
|
||||||
tags.forEach(({ node }) => {
|
tags.forEach(({ node }) => {
|
||||||
createPage({
|
createPage({
|
||||||
path: `tag/${slugify(node.frontmatter.title)}`,
|
path: `tag/${slugify(node.frontmatter.title)}/`,
|
||||||
component: tagTemplate,
|
component: tagTemplate,
|
||||||
context: {
|
context: {
|
||||||
title: node.frontmatter.title,
|
title: node.frontmatter.title,
|
||||||
|
|||||||
@ -119,8 +119,9 @@ const Article = ({
|
|||||||
owner,
|
owner,
|
||||||
admin: admin.split(","),
|
admin: admin.split(","),
|
||||||
language: "ru",
|
language: "ru",
|
||||||
id: pathname,
|
id: slug,
|
||||||
title: title,
|
title: title,
|
||||||
|
labels: ["Статья", "Обсуждение"],
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
|
|||||||
@ -10,7 +10,7 @@ const ArticleCard = ({
|
|||||||
return (
|
return (
|
||||||
<article className="article-card">
|
<article className="article-card">
|
||||||
<div className="article-card__image">
|
<div className="article-card__image">
|
||||||
<Link to={`/article/${slug}`}>
|
<Link to={`/article/${slug}/`}>
|
||||||
<Img
|
<Img
|
||||||
loading="eager"
|
loading="eager"
|
||||||
fadeIn={false}
|
fadeIn={false}
|
||||||
@ -21,17 +21,17 @@ const ArticleCard = ({
|
|||||||
</div>
|
</div>
|
||||||
<div className="article-card__heading">
|
<div className="article-card__heading">
|
||||||
<h2>
|
<h2>
|
||||||
<Link to={`/article/${slug}`}>{title}</Link>
|
<Link to={`/article/${slug}/`}>{title}</Link>
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
<div className="article-card__category">
|
<div className="article-card__category">
|
||||||
<Link to={`/category/${slugify(category)}`}>{category}</Link>
|
<Link to={`/category/${slugify(category)}/`}>{category}</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className="article-card__tags">
|
<div className="article-card__tags">
|
||||||
<ul>
|
<ul>
|
||||||
{tags.map((tag, i) => (
|
{tags.map((tag, i) => (
|
||||||
<li className="tag-item" key={i}>
|
<li className="tag-item" key={i}>
|
||||||
<Link to={`/tag/${tag}`}>{tag}</Link>
|
<Link to={`/tag/${tag}/`}>{tag}</Link>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@ -15,7 +15,7 @@ const CategoryItem = ({ title }) => {
|
|||||||
: "tag-item"
|
: "tag-item"
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Link to={`/category/${slugify(title)}`}>{title}</Link>
|
<Link to={`/category/${slugify(title)}/`}>{title}</Link>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@ const PopularItem = ({ slug, title }) => {
|
|||||||
return (
|
return (
|
||||||
<div className="article-item">
|
<div className="article-item">
|
||||||
<div className="article-item__title">
|
<div className="article-item__title">
|
||||||
<Link to={`/article/${slug}`}>{title}</Link>
|
<Link to={`/article/${slug}/`}>{title}</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className="article-item__views"></div>
|
<div className="article-item__views"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import sligify from "../../../helpers/slugify"
|
|||||||
const TagItem = ({ title }) => {
|
const TagItem = ({ title }) => {
|
||||||
return (
|
return (
|
||||||
<div className="tag-item">
|
<div className="tag-item">
|
||||||
<Link to={`/tag/${sligify(title)}`}>{title}</Link>
|
<Link to={`/tag/${sligify(title)}/`}>{title}</Link>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,16 +1,14 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import PropTypes from "prop-types"
|
import PropTypes from "prop-types"
|
||||||
import { useLocation } from "@reach/router"
|
|
||||||
import GitalkComponent from "gitalk/dist/gitalk-component"
|
import GitalkComponent from "gitalk/dist/gitalk-component"
|
||||||
import useSiteMetadataQuery from "../../hooks/useSiteMetadataQuery"
|
import useSiteMetadataQuery from "../../hooks/useSiteMetadataQuery"
|
||||||
|
|
||||||
const Snippet = ({ data: { description, title, date }, html }) => {
|
const Snippet = ({ data: { slug, description, title, date }, html }) => {
|
||||||
const {
|
const {
|
||||||
siteMetadata: {
|
siteMetadata: {
|
||||||
gitalk: { clientID, clientSecret, repo, owner, admin },
|
gitalk: { clientID, clientSecret, repo, owner, admin },
|
||||||
},
|
},
|
||||||
} = useSiteMetadataQuery()
|
} = useSiteMetadataQuery()
|
||||||
const { pathname } = useLocation()
|
|
||||||
const [readyComments, setReadyComments] = React.useState(false)
|
const [readyComments, setReadyComments] = React.useState(false)
|
||||||
|
|
||||||
React.useEffect(() => setReadyComments(true), [setReadyComments])
|
React.useEffect(() => setReadyComments(true), [setReadyComments])
|
||||||
@ -40,8 +38,9 @@ const Snippet = ({ data: { description, title, date }, html }) => {
|
|||||||
owner,
|
owner,
|
||||||
admin: admin.split(","),
|
admin: admin.split(","),
|
||||||
language: "ru",
|
language: "ru",
|
||||||
id: pathname,
|
id: slug,
|
||||||
title: title,
|
title: title,
|
||||||
|
labels: ["Сниппет", "Обсуждение"],
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
|
|||||||
@ -7,7 +7,7 @@ const SnippetItem = ({ slug, title, date, tags }) => {
|
|||||||
<div className="left-info">
|
<div className="left-info">
|
||||||
<div className="snippet-item__date">{date}</div>
|
<div className="snippet-item__date">{date}</div>
|
||||||
<div className="snippet-item__heading">
|
<div className="snippet-item__heading">
|
||||||
<Link to={`/snippet/${slug}`}>{title}</Link>
|
<Link to={`/snippet/${slug}/`}>{title}</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="right-info">
|
<div className="right-info">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user