mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2024-12-27 07:18:17 +01:00
Merge pull request #45 from ybbarng/master
Fixes a crash when a post has no tag
This commit is contained in:
commit
4ad32fb854
@ -123,7 +123,7 @@ exports.onCreateNode = ({ node, boundActionCreators, getNode }) => {
|
|||||||
value: slug
|
value: slug
|
||||||
});
|
});
|
||||||
|
|
||||||
if (typeof node.frontmatter.tags !== 'undefined') {
|
if (node.frontmatter.tags) {
|
||||||
const tagSlugs = node.frontmatter.tags.map(
|
const tagSlugs = node.frontmatter.tags.map(
|
||||||
tag => `/tags/${_.kebabCase(tag)}/`
|
tag => `/tags/${_.kebabCase(tag)}/`
|
||||||
);
|
);
|
||||||
|
@ -19,7 +19,7 @@ class PostTemplateDetails extends React.Component {
|
|||||||
const tagsBlock = (
|
const tagsBlock = (
|
||||||
<div className="post-single__tags">
|
<div className="post-single__tags">
|
||||||
<ul className="post-single__tags-list">
|
<ul className="post-single__tags-list">
|
||||||
{tags.map((tag, i) =>
|
{tags && tags.map((tag, i) =>
|
||||||
<li className="post-single__tags-list-item" key={tag}>
|
<li className="post-single__tags-list-item" key={tag}>
|
||||||
<Link to={tag} className="post-single__tags-list-item-link">
|
<Link to={tag} className="post-single__tags-list-item-link">
|
||||||
{post.frontmatter.tags[i]}
|
{post.frontmatter.tags[i]}
|
||||||
|
Loading…
Reference in New Issue
Block a user