#How can I create a shared layout for a directory?

1 messages · Page 1 of 1 (latest)

frosty steeple
#

I'm trying to create a blog with Solid Start and Markdown and am running into issues creating layouts specifically for the blog posts. Ideally, the following URLs have the following mapping:

  • /blog --> the blog overview
  • /blog/hello-world --> the post "hello-world.mdx"

The blog posts have their own layout, so somewhere I'll need a page file with an <Outlet> tag. Where should I place this?

Here are some file structures I've tried.

Does not register the layout.

/blog.tsx
/blog/(layout).tsx
/blog/hello-world.mdx
/blog/(index).tsx
/blog/(layout).tsx -- Error! two default pages
/blog/hello-world.mdx
Produces the correct layout, but wrong URL structure.

/blog/(index).tsx
/blog/posts/(layout).tsx
/blog/posts/hello-world.mdx
Does not use the correct layout

/blog/index.tsx
/blog/(post).tsx
/blog/hello-world.mdx
Does not use the correct layout

/blog/index.tsx
/blog/[id].tsx
/blog/hello-world.mdx
frosty steeple
#

How can I create a shared layout for a directory?

worn silo
#

@frosty steeple is this thread still relevant to you?

frosty steeple
#

It is