diff --git a/gatsby-node.esm.js b/gatsby-node.esm.js index 92f3edf..3b2531b 100644 --- a/gatsby-node.esm.js +++ b/gatsby-node.esm.js @@ -46,7 +46,7 @@ exports.createPages = async ({ actions, graphql }) => { articles.forEach(({ node }) => { createPage({ - path: `article/${node.frontmatter.slug}`, + path: `article/${node.frontmatter.slug}/`, component: articleTemplate, context: { slug: node.frontmatter.slug, @@ -56,7 +56,7 @@ exports.createPages = async ({ actions, graphql }) => { snippets.forEach(({ node }) => { createPage({ - path: `snippet/${node.frontmatter.slug}`, + path: `snippet/${node.frontmatter.slug}/`, component: snippetTemplate, context: { slug: node.frontmatter.slug, @@ -66,7 +66,7 @@ exports.createPages = async ({ actions, graphql }) => { categories.forEach(({ node }) => { createPage({ - path: `category/${slugify(node.frontmatter.title)}`, + path: `category/${slugify(node.frontmatter.title)}/`, component: categoryTemplate, context: { title: node.frontmatter.title, @@ -76,7 +76,7 @@ exports.createPages = async ({ actions, graphql }) => { tags.forEach(({ node }) => { createPage({ - path: `tag/${slugify(node.frontmatter.title)}`, + path: `tag/${slugify(node.frontmatter.title)}/`, component: tagTemplate, context: { title: node.frontmatter.title, diff --git a/src/components/Article/Article.js b/src/components/Article/Article.js index c330d36..5a37cd8 100644 --- a/src/components/Article/Article.js +++ b/src/components/Article/Article.js @@ -119,8 +119,9 @@ const Article = ({ owner, admin: admin.split(","), language: "ru", - id: pathname, + id: slug, title: title, + labels: ["Статья", "Обсуждение"], }} /> ) : null} diff --git a/src/components/Articles/ArticleCard/ArticleCard.js b/src/components/Articles/ArticleCard/ArticleCard.js index b074df5..f49dc97 100644 --- a/src/components/Articles/ArticleCard/ArticleCard.js +++ b/src/components/Articles/ArticleCard/ArticleCard.js @@ -10,7 +10,7 @@ const ArticleCard = ({ return (
- +

- {title} + {title}

- {category} + {category}
    {tags.map((tag, i) => (
  • - {tag} + {tag}
  • ))}
diff --git a/src/components/Articles/Categories/CategoryItem.js b/src/components/Articles/Categories/CategoryItem.js index 6e3afbd..e14d33f 100644 --- a/src/components/Articles/Categories/CategoryItem.js +++ b/src/components/Articles/Categories/CategoryItem.js @@ -15,7 +15,7 @@ const CategoryItem = ({ title }) => { : "tag-item" } > - {title} + {title}
) } diff --git a/src/components/Offers/Popular/PopularItem.js b/src/components/Offers/Popular/PopularItem.js index 2fc7461..d71b59a 100644 --- a/src/components/Offers/Popular/PopularItem.js +++ b/src/components/Offers/Popular/PopularItem.js @@ -6,7 +6,7 @@ const PopularItem = ({ slug, title }) => { return (
- {title} + {title}
diff --git a/src/components/Offers/Tags/TagItem.js b/src/components/Offers/Tags/TagItem.js index 2a1e06b..6436f72 100644 --- a/src/components/Offers/Tags/TagItem.js +++ b/src/components/Offers/Tags/TagItem.js @@ -6,7 +6,7 @@ import sligify from "../../../helpers/slugify" const TagItem = ({ title }) => { return (
- {title} + {title}
) } diff --git a/src/components/Snippet/Snippet.js b/src/components/Snippet/Snippet.js index deb0e49..c0e9201 100644 --- a/src/components/Snippet/Snippet.js +++ b/src/components/Snippet/Snippet.js @@ -1,16 +1,14 @@ import React from "react" import PropTypes from "prop-types" -import { useLocation } from "@reach/router" import GitalkComponent from "gitalk/dist/gitalk-component" import useSiteMetadataQuery from "../../hooks/useSiteMetadataQuery" -const Snippet = ({ data: { description, title, date }, html }) => { +const Snippet = ({ data: { slug, description, title, date }, html }) => { const { siteMetadata: { gitalk: { clientID, clientSecret, repo, owner, admin }, }, } = useSiteMetadataQuery() - const { pathname } = useLocation() const [readyComments, setReadyComments] = React.useState(false) React.useEffect(() => setReadyComments(true), [setReadyComments]) @@ -40,8 +38,9 @@ const Snippet = ({ data: { description, title, date }, html }) => { owner, admin: admin.split(","), language: "ru", - id: pathname, + id: slug, title: title, + labels: ["Сниппет", "Обсуждение"], }} /> ) : null} diff --git a/src/components/Snippets/SnippetItem/SnippetItem.js b/src/components/Snippets/SnippetItem/SnippetItem.js index 28211f0..013711b 100644 --- a/src/components/Snippets/SnippetItem/SnippetItem.js +++ b/src/components/Snippets/SnippetItem/SnippetItem.js @@ -7,7 +7,7 @@ const SnippetItem = ({ slug, title, date, tags }) => {
{date}
- {title} + {title}