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

☂️ Dynamic Routing #121

Closed
saurabhdaware opened this issue Apr 2, 2021 · 1 comment
Closed

☂️ Dynamic Routing #121

saurabhdaware opened this issue Apr 2, 2021 · 1 comment
Labels
v1.0.0 Will be implemented in version 1 of Abell
Milestone

Comments

@saurabhdaware
Copy link
Member

Currently, there is a lot of abstraction in dynamic routing. We loop over content directory, read the names of the folders inside and pass it in Abell.meta.$path in theme/[path]/index.abell. You can check it out in https://github.com/abelljs/abell-starter-minima

However, this is too much of abstraction and something that we want to avoid in Abell going forward.

Problems with Current Dynamic Routing

  • Explaining how this whole thing works is complicated.
  • Things are bound to certain directory names ([path], content). In some cases it is fine but ideally, we should give helper functions to the user and the user should be one to decide how he wants to loop over a certain directory or what data they want to read.)
  • What if I have two pages as a layout that want to loop over two different sets of contents? this is just not possible right now.

This is one major issue that stops us from releasing v1.0.0 as the changes are going to affect the important part of Abell.

Goals

  • Running dev-server by having just one .abell file should still work!
  • Provide better APIs that explain how Abell is building site

Additional Information

How different Static-Site-Generators handle this-

Eleventy

Eleventy allows you to define layout in frontmatter of the content and then drops a content variable in that particular layout with the content of the markdown.
https://www.11ty.dev/docs/layouts/


This issue needs some brainstorming about the possible ways to move forward with dynamic routing.

Originally posted by @saurabhdaware in #111

@saurabhdaware saurabhdaware added the v1.0.0 Will be implemented in version 1 of Abell label Apr 2, 2021
@saurabhdaware saurabhdaware added this to the v1.0.0 milestone Apr 2, 2021
@saurabhdaware
Copy link
Member Author

A new solution is proposed in v1 with makeRoutes API https://github.com/abelljs/abell/releases/tag/abell-v1.0.0-alpha.37

Closing this issue for now. Will re-open if that routing doesn't work out well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v1.0.0 Will be implemented in version 1 of Abell
Projects
None yet
Development

No branches or pull requests

1 participant