Skip to content
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
Binary file modified .DS_Store
Binary file not shown.
12 changes: 12 additions & 0 deletions e2e/portfolio.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ test('homepage accessibility', async ({ page }) => {
expect(results.violations).toEqual([])
})

test('static portfolio pages omit article metadata while articles retain it', async ({
page
}) => {
for (const path of ['/resume', '/recommendations']) {
await page.goto(path)
await expect(page.locator('body')).not.toContainText(/\d+ min read/)
}

await page.goto('/posts/working-remotely-from-pakistan')
await expect(page.locator('body')).toContainText(/\d+ min read/)
})

test('navigation, feed discovery, and internal routes work', async ({
page
}) => {
Expand Down
15 changes: 15 additions & 0 deletions mdx-components.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,24 @@ const blogComponents = getBlogMDXComponents({
})
})

function PortfolioMdxWrapper({ children, metadata }) {
if (metadata.filePath?.startsWith('app/posts/')) {
const BlogWrapper = blogComponents.wrapper
return <BlogWrapper metadata={metadata}>{children}</BlogWrapper>
}

return (
<>
<h1>{metadata.title}</h1>
{children}
</>
)
}

export function useMDXComponents(components) {
return {
...blogComponents,
wrapper: PortfolioMdxWrapper,
...components
}
}
Binary file modified public/.DS_Store
Binary file not shown.
Binary file modified public/downloads/MohsinHayatResume.pdf
Binary file not shown.