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

💡 RFC: Allow to set a default layout for all posts #723

Closed
1 of 3 tasks
stenehall opened this issue Jul 16, 2021 · 3 comments
Closed
1 of 3 tasks

💡 RFC: Allow to set a default layout for all posts #723

stenehall opened this issue Jul 16, 2021 · 3 comments

Comments

@stenehall
Copy link
Contributor

Background & Motivation

Importing a set of blog posts there's a lot of extra work having to set layout for each post.

It would be great if there was a posibility to set a default layout in astro.cofig.mjs

Proposed Solution

Possible solutions

Extend astro.config.mjs with defaultLayout

Alternatives considered

One other possible solution would be having default layout.astro files in each folder, but this seems far more complex.

Risks, downsides, and/or tradeoffs

Added complexity. Opening up for having a default layout means the next step is having one per folder and so on. It might create unnecessary complexity.

Open Questions

Is astro.config.mjs the intended place for all settings? Could we have a per folder settings file? placing a layout.astro file in src/pages/posts for example.

Detailed Design

No response

Help make it happen!

  • I am willing to submit a PR to implement this change.
  • I am willing to submit a PR to implement this change, but would need some guidance.
  • I am not willing to submit a PR to implement this change.
@L1lith
Copy link

L1lith commented Jul 17, 2021

I think this is a duplicate of this issue

@stenehall
Copy link
Contributor Author

I think this is a duplicate of this issue

From my understanding of what _app.js It’s not really meant to solve the same thing, but definitely overlap. The app file is your general wrapper for everything. You might then want one design for pages and one design for blog posts. That’s where a default layout comes in. For the blog posts you’d not want to have to set a layout for each post.

@FredKSchott
Copy link
Member

Duplicat of #397

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

3 participants