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

Making the posts page index page #43

Open
mertdeveci5 opened this issue Jan 8, 2024 · 1 comment
Open

Making the posts page index page #43

mertdeveci5 opened this issue Jan 8, 2024 · 1 comment

Comments

@mertdeveci5
Copy link

Is there a way to make the posts page the index default page? I believe that should be the case as this is a blogpost website.

Also what is the best way to customise the design of the pages?

Note: Not sure if nextra is still maintained

@MiConnell
Copy link

I think the best workaround I found for this is making index.mdx look like this

---
type: posts
title: Posts
date: 2024-03-28
---

and then moving the about page to pages/about/index.mdx

this way the homepage is your posts directory and then the about section is a header link.

Give it a shot and let me know if this works for you.

In terms of design you can still use nextjs components, for example adding an image to the about page:

import Image from 'next/image'

<div style={{
  display: 'flex',
  justifyContent: 'center',
  alignItems: 'center',
  height: '100%',
}}>
  <div style={{
    borderRadius: '50%',
    overflow: 'hidden',
    width: '250px',
    height: '250px',
    margin: 'auto',
  }}>
    <Image
      src="/images/profile.png"
      alt="Photo"
      width={250}
      height={250}
      priority
      className="next-image"
    />
  </div>
</div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants