Skip to content

Commit

Permalink
Fix posts urls on tags page & remove warnings
Browse files Browse the repository at this point in the history
- Edit constant value of posts url
- Remove console warnings:
  * Each child in a list should have a unique key prop
  * Extra attributes from the server: aria-hidden

- Also next version is updated

Signed-off-by: Randy <randymoralesg@gmail.com>
  • Loading branch information
randymorales committed Feb 19, 2021
1 parent ba2db43 commit 1c58844
Show file tree
Hide file tree
Showing 8 changed files with 540 additions and 4,742 deletions.
6 changes: 3 additions & 3 deletions components/Intro.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function Intro() {
target='_blank'
rel='noopener'
>
<i className='fab fa-twitter big-icon'></i>
<i aria-hidden className='fab fa-twitter big-icon'></i>
</a>
</li>

Expand All @@ -40,7 +40,7 @@ export default function Intro() {
target='_blank'
rel='noopener'
>
<i className='fab fa-linkedin big-icon'></i>
<i aria-hidden className='fab fa-linkedin big-icon'></i>
</a>
</li>

Expand All @@ -50,7 +50,7 @@ export default function Intro() {
target='_blank'
rel='noopener'
>
<i className='fab fa-github big-icon'></i>
<i aria-hidden className='fab fa-github big-icon'></i>
</a>
</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion components/PostCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function PostCard({
<div className={blogStyles.cardMetadata}>
<div>
{tagsList.map(tag => (
<Link href={`/tags/${tag}/`}>
<Link href={`/tags/${tag}/`} key={tag}>
<a className={[blogStyles.cardTag, tag].join(' ')}>{tag}</a>
</Link>
))}
Expand Down
2 changes: 1 addition & 1 deletion lib/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const LightTheme = 'light'

const Name = 'Randy'

const PostsDirectory = 'blog/'
const PostsDirectory = '/blog/'

const SiteBaseURL = `https://${Domain}`

Expand Down
5,265 changes: 530 additions & 4,735 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"date-fns": "^2.16.1",
"gray-matter": "^4.0.2",
"next": "^10",
"next": "^10.0.7",
"react": "^17",
"react-dom": "^17",
"react-transition-group": "^4.4.1",
Expand Down
1 change: 1 addition & 0 deletions pages/blog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default function BlogIndex({ allLocalePostsData }) {
{allLocalePostsData.map(
({ id, title, description, date, tags, image }) => (
<PostCard
key={id}
url={`${PostsDirectory}${id}`}
title={title}
description={description}
Expand Down
1 change: 1 addition & 0 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default function Home({ allLocalePostsData }) {
{lastBlogEntries.map(
({ id, title, description, date, tags, image }) => (
<PostCard
key={id}
url={`${PostsDirectory}${id}`}
title={title}
description={description}
Expand Down
3 changes: 2 additions & 1 deletion pages/tags/[tag].js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ export default function TagIndex({ posts, tag }) {
{t('posts-found')}: {posts.length}
</h4>

<div class='page-separator'>
<div className='page-separator'>
<hr />
</div>

<section className={blogStyles.cardsContainer}>
{/* List blog posts */}
{posts.map(({ id, title, description, date, tags, image }) => (
<PostCard
key={id}
url={`${PostsDirectory}${id}`}
title={title}
description={description}
Expand Down

1 comment on commit 1c58844

@vercel
Copy link

@vercel vercel bot commented on 1c58844 Feb 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.