@@ -44,22 +44,7 @@ export const pageQuery = graphql`
query TagsQuery {
site {
siteMetadata {
- title
- subtitle
- copyright
- menu {
- label
- path
- }
- author {
- name
- email
- telegram
- twitter
- github
- rss
- vk
- }
+ ...sidebarFragment
}
}
allMarkdownRemark(
diff --git a/src/templates/category-template.jsx b/src/templates/category-template.jsx
index 713b8d1..ca05402 100644
--- a/src/templates/category-template.jsx
+++ b/src/templates/category-template.jsx
@@ -5,14 +5,15 @@ import CategoryTemplateDetails from '../components/CategoryTemplateDetails';
class CategoryTemplate extends React.Component {
render() {
- const { title } = this.props.data.site.siteMetadata;
- const { category } = this.props.pathContext;
+ const title = this.props.data.site.siteMetadata.title;
+ const category = this.props.pathContext.category;
+ const posts = this.props.data.allMarkdownRemark.edges
return (
-
-
+
+
);
}
@@ -24,22 +25,7 @@ export const pageQuery = graphql`
query CategoryPage($category: String) {
site {
siteMetadata {
- title
- subtitle
- copyright
- menu {
- label
- path
- }
- author {
- name
- email
- telegram
- twitter
- github
- rss
- vk
- }
+ ...sidebarFragment
}
}
allMarkdownRemark(
diff --git a/src/templates/page-template.jsx b/src/templates/page-template.jsx
index b5e4d56..0a60b37 100644
--- a/src/templates/page-template.jsx
+++ b/src/templates/page-template.jsx
@@ -4,7 +4,8 @@ import PageTemplateDetails from '../components/PageTemplateDetails';
class PageTemplate extends React.Component {
render() {
- const { title, subtitle } = this.props.data.site.siteMetadata;
+ const siteMetadata = this.props.data.site.siteMetadata;
+ const { title, subtitle } = siteMetadata;
const page = this.props.data.markdownRemark;
const { title: pageTitle, description: pageDescription } = page.frontmatter;
const description = pageDescription !== null ? pageDescription : subtitle;
@@ -15,7 +16,10 @@ class PageTemplate extends React.Component {
{`${pageTitle} - ${title}`}
-
+
);
}
@@ -27,22 +31,7 @@ export const pageQuery = graphql`
query PageBySlug($slug: String!) {
site {
siteMetadata {
- title
- subtitle
- copyright
- menu {
- label
- path
- }
- author {
- name
- email
- telegram
- twitter
- github
- rss
- vk
- }
+ ...sidebarFragment
}
}
markdownRemark(fields: { slug: { eq: $slug } }) {
diff --git a/src/templates/post-template.jsx b/src/templates/post-template.jsx
index 9ddfb93..4853a52 100644
--- a/src/templates/post-template.jsx
+++ b/src/templates/post-template.jsx
@@ -4,7 +4,8 @@ import PostTemplateDetails from '../components/PostTemplateDetails';
class PostTemplate extends React.Component {
render() {
- const { title, subtitle } = this.props.data.site.siteMetadata;
+ const siteMetadata = this.props.data.site.siteMetadata;
+ const { title, subtitle } = siteMetadata;
const post = this.props.data.markdownRemark;
const { title: postTitle, description: postDescription } = post.frontmatter;
const description = postDescription !== null ? postDescription : subtitle;
@@ -15,7 +16,7 @@ class PostTemplate extends React.Component {
{`${postTitle} - ${title}`}
-
+
);
}
@@ -29,7 +30,6 @@ export const pageQuery = graphql`
siteMetadata {
title
subtitle
- copyright
author {
name
twitter
diff --git a/src/templates/tag-template.jsx b/src/templates/tag-template.jsx
index 2eff8eb..979f108 100644
--- a/src/templates/tag-template.jsx
+++ b/src/templates/tag-template.jsx
@@ -11,8 +11,8 @@ class TagTemplate extends React.Component {
return (
);
}
@@ -24,22 +24,7 @@ export const pageQuery = graphql`
query TagPage($tag: String) {
site {
siteMetadata {
- title
- subtitle
- copyright
- menu {
- label
- path
- }
- author {
- name
- email
- telegram
- twitter
- github
- rss
- vk
- }
+ ...sidebarFragment
}
}
allMarkdownRemark(