Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v3] Avoid skipping the heading level in the posts layout #3100

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/gold-ants-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'nextra-theme-blog': patch
---

Avoid skipping the heading level in the posts layout, removes `.post-item` and `.post-item-more` classes
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ module.exports = {
settings: {
tailwindcss: {
config: 'packages/nextra-theme-blog/tailwind.config.ts',
whitelist: ['subheading-', 'post-item', 'post-item-more']
whitelist: ['subheading-']
}
}
},
Expand Down
2 changes: 0 additions & 2 deletions examples/blog/pages/posts/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ type: posts
title: Random Thoughts
date: 2020-01-03
---

# Random Thoughts
12 changes: 5 additions & 7 deletions packages/nextra-theme-blog/src/posts-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,15 @@ export function PostsLayout(): ReactElement {
const description = post.frontMatter?.description

return (
<div key={post.route} className="post-item">
<h3>
<Link href={post.route} className="!_no-underline">
{postTitle}
</Link>
</h3>
<div key={post.route}>
<h2 className="_not-prose _mt-6 _mb-2 _text-xl _font-semibold">
<Link href={post.route}>{postTitle}</Link>
</h2>
{description && (
<p className="_mb-2 dark:_text-gray-400 _text-gray-600">
{description}
{config.readMore && (
<Link href={post.route} className="post-item-more _ml-2">
<Link href={post.route} className="_ml-2">
{config.readMore}
</Link>
)}
Expand Down
Loading