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

Named slots #12

Open
karneaud opened this issue Feb 10, 2022 · 4 comments
Open

Named slots #12

karneaud opened this issue Feb 10, 2022 · 4 comments

Comments

@karneaud
Copy link

Does your frame work support named slots?

e.g.

<_slot name="head"/>
<_slot />
@karneaud karneaud changed the title slots Named slots Feb 10, 2022
@CTNicholas
Copy link
Owner

Hi, I'm sorry I don't think it does! Keystone is getting a little old now. If you're after something newer there's some really cool tools, in particular Astro, which can be used for similar purposes!

@karneaud
Copy link
Author

karneaud commented Feb 14, 2022

Keystone is getting a little old now.

Oh man that's sad to hear. I took a look at Astro and it was a bit much for what I wanted to do. Keystone really has the exact philosophy and concept that I'm looking for.

I want to try to take a look at it in in-depth and implement some new features if I can and submit a pull request.

@karneaud
Copy link
Author

I was hoping for implementing features similar to https://sergey.cool/. What I did not like about sergey is its recompile concept.

@CTNicholas
Copy link
Owner

CTNicholas commented Feb 15, 2022

Oh right, yes Astro can do a lot! But it's also really good at plain HTML slots too:
src/components/Layout.astro:

---
const { title = 'Fallback if no title passed' } = Astro.props
---
<html lang="en">
  <head>
    <title>{title}</title>
  </head>

  <body>
    <slot name="main">
      Fallback content if no slot provided
    </slot>
  </body>
</html>

src/pages/index.astro:

---
import Layout from '../components/Layout.astro'
---
<Layout title="My title">
  <div slot="main">
    Main content
  </div>
</Layout>

Though in saying that, I'll happily review any changes you make to Keystone 😄

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