mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2025-07-27 04:32:32 +02:00
New version
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import Helmet from 'react-helmet';
|
||||
import Sidebar from '../components/Sidebar';
|
||||
import CategoryTemplateDetails from '../components/CategoryTemplateDetails';
|
||||
@@ -19,19 +18,6 @@ class CategoryTemplate extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
CategoryTemplate.propTypes = {
|
||||
data: PropTypes.shape({
|
||||
site: PropTypes.shape({
|
||||
siteMetadata: PropTypes.shape({
|
||||
title: PropTypes.string.isRequired
|
||||
})
|
||||
})
|
||||
}),
|
||||
pathContext: PropTypes.shape({
|
||||
category: PropTypes.string.isRequired
|
||||
})
|
||||
};
|
||||
|
||||
export default CategoryTemplate;
|
||||
|
||||
export const pageQuery = graphql`
|
@@ -1,5 +1,4 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import Helmet from 'react-helmet';
|
||||
import PageTemplateDetails from '../components/PageTemplateDetails';
|
||||
|
||||
@@ -7,18 +6,13 @@ class PageTemplate extends React.Component {
|
||||
render() {
|
||||
const { title, subtitle } = this.props.data.site.siteMetadata;
|
||||
const page = this.props.data.markdownRemark;
|
||||
|
||||
let description;
|
||||
if (page.frontmatter.description !== null) {
|
||||
description = page.frontmatter.description;
|
||||
} else {
|
||||
description = subtitle;
|
||||
}
|
||||
const { title: pageTitle, description: pageDescription } = page.frontmatter;
|
||||
const description = pageDescription !== null ? pageDescription : subtitle;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Helmet>
|
||||
<title>{`${page.frontmatter.title} - ${title}`}</title>
|
||||
<title>{`${pageTitle} - ${title}`}</title>
|
||||
<meta name="description" content={description} />
|
||||
</Helmet>
|
||||
<PageTemplateDetails {...this.props} />
|
||||
@@ -27,18 +21,6 @@ class PageTemplate extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
PageTemplate.propTypes = {
|
||||
data: PropTypes.shape({
|
||||
site: PropTypes.shape({
|
||||
siteMetadata: PropTypes.shape({
|
||||
title: PropTypes.string.isRequired,
|
||||
subtitle: PropTypes.string.isRequired
|
||||
})
|
||||
}),
|
||||
markdownRemark: PropTypes.object.isRequired
|
||||
})
|
||||
};
|
||||
|
||||
export default PageTemplate;
|
||||
|
||||
export const pageQuery = graphql`
|
@@ -1,5 +1,4 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import Helmet from 'react-helmet';
|
||||
import PostTemplateDetails from '../components/PostTemplateDetails';
|
||||
|
||||
@@ -7,18 +6,13 @@ class PostTemplate extends React.Component {
|
||||
render() {
|
||||
const { title, subtitle } = this.props.data.site.siteMetadata;
|
||||
const post = this.props.data.markdownRemark;
|
||||
|
||||
let description;
|
||||
if (post.frontmatter.description !== null) {
|
||||
description = post.frontmatter.description;
|
||||
} else {
|
||||
description = subtitle;
|
||||
}
|
||||
const { title: postTitle, description: postDescription } = post.frontmatter;
|
||||
const description = postDescription !== null ? postDescription : subtitle;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Helmet>
|
||||
<title>{`${post.frontmatter.title} - ${title}`}</title>
|
||||
<title>{`${postTitle} - ${title}`}</title>
|
||||
<meta name="description" content={description} />
|
||||
</Helmet>
|
||||
<PostTemplateDetails {...this.props} />
|
||||
@@ -27,18 +21,6 @@ class PostTemplate extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
PostTemplate.propTypes = {
|
||||
data: PropTypes.shape({
|
||||
site: PropTypes.shape({
|
||||
siteMetadata: PropTypes.shape({
|
||||
title: PropTypes.string.isRequired,
|
||||
subtitle: PropTypes.string.isRequired
|
||||
})
|
||||
}),
|
||||
markdownRemark: PropTypes.object.isRequired
|
||||
})
|
||||
};
|
||||
|
||||
export default PostTemplate;
|
||||
|
||||
export const pageQuery = graphql`
|
@@ -1,5 +1,4 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import Helmet from 'react-helmet';
|
||||
import Sidebar from '../components/Sidebar';
|
||||
import TagTemplateDetails from '../components/TagTemplateDetails';
|
||||
@@ -19,19 +18,6 @@ class TagTemplate extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
TagTemplate.propTypes = {
|
||||
data: PropTypes.shape({
|
||||
site: PropTypes.shape({
|
||||
siteMetadata: PropTypes.shape({
|
||||
title: PropTypes.string.isRequired
|
||||
})
|
||||
})
|
||||
}),
|
||||
pathContext: PropTypes.shape({
|
||||
tag: PropTypes.string.isRequired
|
||||
})
|
||||
};
|
||||
|
||||
export default TagTemplate;
|
||||
|
||||
export const pageQuery = graphql`
|
Reference in New Issue
Block a user